aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/commsup.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aacraid/commsup.c')
-rw-r--r--drivers/scsi/aacraid/commsup.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 9f9f4aae23c0..3f27419c66af 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -229,8 +229,7 @@ void aac_fib_init(struct fib *fibptr)
229static void fib_dealloc(struct fib * fibptr) 229static void fib_dealloc(struct fib * fibptr)
230{ 230{
231 struct hw_fib *hw_fib = fibptr->hw_fib; 231 struct hw_fib *hw_fib = fibptr->hw_fib;
232 if(hw_fib->header.StructType != FIB_MAGIC) 232 BUG_ON(hw_fib->header.StructType != FIB_MAGIC);
233 BUG();
234 hw_fib->header.XferState = 0; 233 hw_fib->header.XferState = 0;
235} 234}
236 235
@@ -472,7 +471,6 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
472 spin_lock_irqsave(q->lock, qflags); 471 spin_lock_irqsave(q->lock, qflags);
473 if (dev->new_comm_interface) { 472 if (dev->new_comm_interface) {
474 unsigned long count = 10000000L; /* 50 seconds */ 473 unsigned long count = 10000000L; /* 50 seconds */
475 list_add_tail(&fibptr->queue, &q->pendingq);
476 q->numpending++; 474 q->numpending++;
477 spin_unlock_irqrestore(q->lock, qflags); 475 spin_unlock_irqrestore(q->lock, qflags);
478 while (aac_adapter_send(fibptr) != 0) { 476 while (aac_adapter_send(fibptr) != 0) {
@@ -481,7 +479,6 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
481 spin_unlock_irqrestore(&fibptr->event_lock, flags); 479 spin_unlock_irqrestore(&fibptr->event_lock, flags);
482 spin_lock_irqsave(q->lock, qflags); 480 spin_lock_irqsave(q->lock, qflags);
483 q->numpending--; 481 q->numpending--;
484 list_del(&fibptr->queue);
485 spin_unlock_irqrestore(q->lock, qflags); 482 spin_unlock_irqrestore(q->lock, qflags);
486 return -ETIMEDOUT; 483 return -ETIMEDOUT;
487 } 484 }
@@ -492,7 +489,6 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
492 unsigned long nointr = 0; 489 unsigned long nointr = 0;
493 aac_queue_get( dev, &index, AdapNormCmdQueue, hw_fib, 1, fibptr, &nointr); 490 aac_queue_get( dev, &index, AdapNormCmdQueue, hw_fib, 1, fibptr, &nointr);
494 491
495 list_add_tail(&fibptr->queue, &q->pendingq);
496 q->numpending++; 492 q->numpending++;
497 *(q->headers.producer) = cpu_to_le32(index + 1); 493 *(q->headers.producer) = cpu_to_le32(index + 1);
498 spin_unlock_irqrestore(q->lock, qflags); 494 spin_unlock_irqrestore(q->lock, qflags);
@@ -520,7 +516,6 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
520 if (--count == 0) { 516 if (--count == 0) {
521 spin_lock_irqsave(q->lock, qflags); 517 spin_lock_irqsave(q->lock, qflags);
522 q->numpending--; 518 q->numpending--;
523 list_del(&fibptr->queue);
524 spin_unlock_irqrestore(q->lock, qflags); 519 spin_unlock_irqrestore(q->lock, qflags);
525 if (wait == -1) { 520 if (wait == -1) {
526 printk(KERN_ERR "aacraid: aac_fib_send: first asynchronous command timed out.\n" 521 printk(KERN_ERR "aacraid: aac_fib_send: first asynchronous command timed out.\n"
@@ -534,8 +529,7 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
534 } 529 }
535 } else 530 } else
536 down(&fibptr->event_wait); 531 down(&fibptr->event_wait);
537 if(fibptr->done == 0) 532 BUG_ON(fibptr->done == 0);
538 BUG();
539 533
540 if((fibptr->flags & FIB_CONTEXT_FLAG_TIMED_OUT)){ 534 if((fibptr->flags & FIB_CONTEXT_FLAG_TIMED_OUT)){
541 return -ETIMEDOUT; 535 return -ETIMEDOUT;
@@ -1214,7 +1208,7 @@ int aac_command_thread(void *data)
1214 * since the last read off 1208 * since the last read off
1215 * the queue? 1209 * the queue?
1216 */ 1210 */
1217 if ((time_now - time_last) > 120) { 1211 if ((time_now - time_last) > aif_timeout) {
1218 entry = entry->next; 1212 entry = entry->next;
1219 aac_close_fib_context(dev, fibctx); 1213 aac_close_fib_context(dev, fibctx);
1220 continue; 1214 continue;