diff options
Diffstat (limited to 'drivers/scsi/aacraid/commsup.c')
-rw-r--r-- | drivers/scsi/aacraid/commsup.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index e67ff13eb359..c933df30f589 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c | |||
@@ -513,15 +513,15 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, | |||
513 | } | 513 | } |
514 | udelay(5); | 514 | udelay(5); |
515 | } | 515 | } |
516 | } else if (down_interruptible(&fibptr->event_wait)) { | 516 | } else |
517 | spin_lock_irqsave(&fibptr->event_lock, flags); | 517 | (void)down_interruptible(&fibptr->event_wait); |
518 | if (fibptr->done == 0) { | 518 | spin_lock_irqsave(&fibptr->event_lock, flags); |
519 | fibptr->done = 2; /* Tell interrupt we aborted */ | 519 | if (fibptr->done == 0) { |
520 | spin_unlock_irqrestore(&fibptr->event_lock, flags); | 520 | fibptr->done = 2; /* Tell interrupt we aborted */ |
521 | return -EINTR; | ||
522 | } | ||
523 | spin_unlock_irqrestore(&fibptr->event_lock, flags); | 521 | spin_unlock_irqrestore(&fibptr->event_lock, flags); |
522 | return -EINTR; | ||
524 | } | 523 | } |
524 | spin_unlock_irqrestore(&fibptr->event_lock, flags); | ||
525 | BUG_ON(fibptr->done == 0); | 525 | BUG_ON(fibptr->done == 0); |
526 | 526 | ||
527 | if((fibptr->flags & FIB_CONTEXT_FLAG_TIMED_OUT)){ | 527 | if((fibptr->flags & FIB_CONTEXT_FLAG_TIMED_OUT)){ |
@@ -1062,7 +1062,7 @@ static int _aac_reset_adapter(struct aac_dev *aac) | |||
1062 | /* | 1062 | /* |
1063 | * Loop through the fibs, close the synchronous FIBS | 1063 | * Loop through the fibs, close the synchronous FIBS |
1064 | */ | 1064 | */ |
1065 | for (index = 0; index < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); index++) { | 1065 | for (retval = 1, index = 0; index < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); index++) { |
1066 | struct fib *fib = &aac->fibs[index]; | 1066 | struct fib *fib = &aac->fibs[index]; |
1067 | if (!(fib->hw_fib_va->header.XferState & cpu_to_le32(NoResponseExpected | Async)) && | 1067 | if (!(fib->hw_fib_va->header.XferState & cpu_to_le32(NoResponseExpected | Async)) && |
1068 | (fib->hw_fib_va->header.XferState & cpu_to_le32(ResponseExpected))) { | 1068 | (fib->hw_fib_va->header.XferState & cpu_to_le32(ResponseExpected))) { |
@@ -1071,8 +1071,12 @@ static int _aac_reset_adapter(struct aac_dev *aac) | |||
1071 | up(&fib->event_wait); | 1071 | up(&fib->event_wait); |
1072 | spin_unlock_irqrestore(&fib->event_lock, flagv); | 1072 | spin_unlock_irqrestore(&fib->event_lock, flagv); |
1073 | schedule(); | 1073 | schedule(); |
1074 | retval = 0; | ||
1074 | } | 1075 | } |
1075 | } | 1076 | } |
1077 | /* Give some extra time for ioctls to complete. */ | ||
1078 | if (retval == 0) | ||
1079 | ssleep(2); | ||
1076 | index = aac->cardtype; | 1080 | index = aac->cardtype; |
1077 | 1081 | ||
1078 | /* | 1082 | /* |