aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/aacraid/commsup.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 4b32ca442433..906a5013edae 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -564,10 +564,10 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
564 * functioning because an interrupt routing or other 564 * functioning because an interrupt routing or other
565 * hardware failure has occurred. 565 * hardware failure has occurred.
566 */ 566 */
567 unsigned long count = 36000000L; /* 3 minutes */ 567 unsigned long timeout = jiffies + (180 * HZ); /* 3 minutes */
568 while (down_trylock(&fibptr->event_wait)) { 568 while (down_trylock(&fibptr->event_wait)) {
569 int blink; 569 int blink;
570 if (--count == 0) { 570 if (time_is_before_eq_jiffies(timeout)) {
571 struct aac_queue * q = &dev->queues->queue[AdapNormCmdQueue]; 571 struct aac_queue * q = &dev->queues->queue[AdapNormCmdQueue];
572 spin_lock_irqsave(q->lock, qflags); 572 spin_lock_irqsave(q->lock, qflags);
573 q->numpending--; 573 q->numpending--;
@@ -588,7 +588,10 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
588 } 588 }
589 return -EFAULT; 589 return -EFAULT;
590 } 590 }
591 udelay(5); 591 /* We used to udelay() here but that absorbed
592 * a CPU when a timeout occured. Not very
593 * useful. */
594 cpu_relax();
592 } 595 }
593 } else if (down_interruptible(&fibptr->event_wait)) { 596 } else if (down_interruptible(&fibptr->event_wait)) {
594 /* Do nothing ... satisfy 597 /* Do nothing ... satisfy