diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2014-11-12 08:11:56 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-20 11:11:07 +0300 |
commit | 22f5f10d2dadc50bf26a482b782a5e04f6e9b362 (patch) | |
tree | 0aa5f5690db24e368f6f3b2dded068889858e9f8 /drivers/scsi/sun3_scsi.c | |
parent | 3f9e986e2f1df8fa69ffe213098c1ee98f1c9584 (diff) | |
download | linux-22f5f10d2dadc50bf26a482b782a5e04f6e9b362.tar.xz |
ncr5380: Fix SCSI_IRQ_NONE bugs
Oak scsi doesn't use any IRQ, but it sets irq = IRQ_NONE rather than
SCSI_IRQ_NONE. Problem is, the core NCR5380 driver expects SCSI_IRQ_NONE
if it is to issue IDENTIFY commands that prevent target disconnection.
And, as Geert points out, IRQ_NONE is part of enum irqreturn.
Other drivers, when they can't get an IRQ or can't use one, will set
host->irq = SCSI_IRQ_NONE (that is, 255). But when they exit they will
attempt to free IRQ 255 which was never requested.
Fix these bugs by using NO_IRQ in place of SCSI_IRQ_NONE and IRQ_NONE.
That means IRQ 0 is no longer probed by ISA drivers but I don't think
this matters.
Setting IRQ = 255 for these ISA drivers is understood to mean no IRQ.
This remains supported so as to avoid breaking existing ISA setups (which
can be difficult to get working) and because existing documentation
(SANE, TLDP etc) describes this usage for the ISA NCR5380 driver options.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/sun3_scsi.c')
-rw-r--r-- | drivers/scsi/sun3_scsi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c index 26b95dcb5e48..3e6386252953 100644 --- a/drivers/scsi/sun3_scsi.c +++ b/drivers/scsi/sun3_scsi.c @@ -278,7 +278,7 @@ static int __init sun3scsi_detect(struct scsi_host_template *tpnt) #ifndef REAL_DMA printk("scsi%d: IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); - instance->irq = SCSI_IRQ_NONE; + instance->irq = NO_IRQ; #else printk("scsi%d: IRQ%d not free, bailing out\n", instance->host_no, instance->irq); @@ -288,7 +288,7 @@ static int __init sun3scsi_detect(struct scsi_host_template *tpnt) pr_info("scsi%d: %s at port %lX irq", instance->host_no, tpnt->proc_name, instance->io_port); - if (instance->irq == SCSI_IRQ_NONE) + if (instance->irq == NO_IRQ) printk ("s disabled"); else printk (" %d", instance->irq); @@ -325,7 +325,7 @@ static int __init sun3scsi_detect(struct scsi_host_template *tpnt) static int sun3scsi_release(struct Scsi_Host *shpnt) { - if (shpnt->irq != SCSI_IRQ_NONE) + if (shpnt->irq != NO_IRQ) free_irq(shpnt->irq, shpnt); iounmap((void *)sun3_scsi_regp); |