[PATCH] qla2xxx: sleep while IRQ disabled fix in eh_abort

Andrew Vasquez
2004-04-01T06:42:57Z

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

On Wed, 31 Mar 2004, James Bottomley wrote:
> On Wed, 2004-03-31 at 18:12, Dave Boutcher wrote:
> > OK, two issues. There are a bunch of SCSI LLDDs that use this same
> > logic in abort and reset handlers to wait for adapter events to
> > complete, so I think the logic is OK. The issue of spin_lock_irq
> > vs spin_lock is a good one...and points out that there are a bunch
> > of LLDDs that are broke :-) I'll resubmit without the _irq
>
> Actually, no, with the irq is correct. Wait_for_completion will sleep,
> and sleeping with interrupts disabled is wrong.
>

Attached is a patch which fixes a problem in qla2xxx_eh_abort() where
we incorrect use spin_unlock() before calling qla2x00_abort_command()
- which can of course sleep.

Please apply.

Thanks,
Andrew Vasquez

[-- Attachment #2: sleep_fix_eh_abort_1.diff --]
[-- Type: text/plain, Size: 463 bytes --]

===== drivers/scsi/qla2xxx/qla_os.c 1.15 vs edited =====
--- 1.15/drivers/scsi/qla2xxx/qla_os.c Mon Mar 22 01:13:23 2004
+++ edited/drivers/scsi/qla2xxx/qla_os.c Wed Mar 31 22:07:14 2004
@@ -1227,7 +1227,7 @@
sp_get(ha, sp);

spin_unlock_irqrestore(&ha->hardware_lock, flags);
- spin_unlock(ha->host->host_lock);
+ spin_unlock_irq(ha->host->host_lock);

if (qla2x00_abort_command(ha, sp)) {
DEBUG2(printk("qla2xxx_eh_abort: abort_command "