ncr5380: Fix SCSI_IRQ_NONE bugs
authorFinn Thain <fthain@telegraphics.com.au>
Wed, 12 Nov 2014 05:11:56 +0000 (16:11 +1100)
committerChristoph Hellwig <hch@lst.de>
Thu, 20 Nov 2014 08:11:07 +0000 (09:11 +0100)
commit22f5f10d2dadc50bf26a482b782a5e04f6e9b362
tree0aa5f5690db24e368f6f3b2dded068889858e9f8
parent3f9e986e2f1df8fa69ffe213098c1ee98f1c9584
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>
drivers/scsi/NCR5380.c
drivers/scsi/NCR5380.h
drivers/scsi/arm/oak.c
drivers/scsi/dmx3191d.c
drivers/scsi/dtc.c
drivers/scsi/g_NCR5380.c
drivers/scsi/mac_scsi.c
drivers/scsi/pas16.c
drivers/scsi/sun3_scsi.c
drivers/scsi/t128.c
This page took 0.029583 seconds and 5 git commands to generate.