diff options
author | Mark Haverkamp <markh@osdl.org> | 2006-08-03 11:02:24 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-08-19 16:32:57 -0400 |
commit | c8f7b073e0e81499474a84ee2a90f77f7805c7f8 (patch) | |
tree | c5421bd69530488d78b76ffab3ebb9fa08000fc7 /drivers/scsi/aacraid/commsup.c | |
parent | 04846f25920d4b05d6040c531cc601049260db52 (diff) |
[SCSI] aacraid: interruptible ioctl
Received from Mark Salyzyn
This patch allows the FSACTL_SEND_LARGE_FIB, FSACTL_SENDFIB and
FSACTL_SEND_RAW_SRB ioctl calls into the aacraid driver to be
interruptible. Only necessary if the adapter and/or the management
software has gone into some sort of misbehavior and the system is being
rebooted, thus permitting the user management software applications to
be killed relatively cleanly. The FIB queue resource is held out of the
free queue until the adapter finally, if ever, completes the command.
Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/commsup.c')
-rw-r--r-- | drivers/scsi/aacraid/commsup.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 3f27419c66af..c67da1321133 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c | |||
@@ -464,6 +464,8 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, | |||
464 | dprintk((KERN_DEBUG " hw_fib pa being sent=%lx\n",(ulong)fibptr->hw_fib_pa)); | 464 | dprintk((KERN_DEBUG " hw_fib pa being sent=%lx\n",(ulong)fibptr->hw_fib_pa)); |
465 | dprintk((KERN_DEBUG " fib being sent=%p\n",fibptr)); | 465 | dprintk((KERN_DEBUG " fib being sent=%p\n",fibptr)); |
466 | 466 | ||
467 | if (!dev->queues) | ||
468 | return -ENODEV; | ||
467 | q = &dev->queues->queue[AdapNormCmdQueue]; | 469 | q = &dev->queues->queue[AdapNormCmdQueue]; |
468 | 470 | ||
469 | if(wait) | 471 | if(wait) |
@@ -527,8 +529,15 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, | |||
527 | } | 529 | } |
528 | udelay(5); | 530 | udelay(5); |
529 | } | 531 | } |
530 | } else | 532 | } else if (down_interruptible(&fibptr->event_wait)) { |
531 | down(&fibptr->event_wait); | 533 | spin_lock_irqsave(&fibptr->event_lock, flags); |
534 | if (fibptr->done == 0) { | ||
535 | fibptr->done = 2; /* Tell interrupt we aborted */ | ||
536 | spin_unlock_irqrestore(&fibptr->event_lock, flags); | ||
537 | return -EINTR; | ||
538 | } | ||
539 | spin_unlock_irqrestore(&fibptr->event_lock, flags); | ||
540 | } | ||
532 | BUG_ON(fibptr->done == 0); | 541 | BUG_ON(fibptr->done == 0); |
533 | 542 | ||
534 | if((fibptr->flags & FIB_CONTEXT_FLAG_TIMED_OUT)){ | 543 | if((fibptr->flags & FIB_CONTEXT_FLAG_TIMED_OUT)){ |
@@ -795,7 +804,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) | |||
795 | 804 | ||
796 | /* Sniff for container changes */ | 805 | /* Sniff for container changes */ |
797 | 806 | ||
798 | if (!dev) | 807 | if (!dev || !dev->fsa_dev) |
799 | return; | 808 | return; |
800 | container = (u32)-1; | 809 | container = (u32)-1; |
801 | 810 | ||