diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2014-11-12 00:11:56 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-20 03:11:07 -0500 |
commit | 22f5f10d2dadc50bf26a482b782a5e04f6e9b362 (patch) | |
tree | 0aa5f5690db24e368f6f3b2dded068889858e9f8 | |
parent | 3f9e986e2f1df8fa69ffe213098c1ee98f1c9584 (diff) |
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>
-rw-r--r-- | drivers/scsi/NCR5380.c | 12 | ||||
-rw-r--r-- | drivers/scsi/NCR5380.h | 5 | ||||
-rw-r--r-- | drivers/scsi/arm/oak.c | 2 | ||||
-rw-r--r-- | drivers/scsi/dmx3191d.c | 7 | ||||
-rw-r--r-- | drivers/scsi/dtc.c | 22 | ||||
-rw-r--r-- | drivers/scsi/g_NCR5380.c | 18 | ||||
-rw-r--r-- | drivers/scsi/mac_scsi.c | 8 | ||||
-rw-r--r-- | drivers/scsi/pas16.c | 20 | ||||
-rw-r--r-- | drivers/scsi/sun3_scsi.c | 6 | ||||
-rw-r--r-- | drivers/scsi/t128.c | 14 |
10 files changed, 66 insertions, 48 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index e17e64e3e0d9..c4b80219868d 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c | |||
@@ -574,12 +574,12 @@ static int __init __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance, | |||
574 | int trying_irqs, i, mask; | 574 | int trying_irqs, i, mask; |
575 | NCR5380_setup(instance); | 575 | NCR5380_setup(instance); |
576 | 576 | ||
577 | for (trying_irqs = i = 0, mask = 1; i < 16; ++i, mask <<= 1) | 577 | for (trying_irqs = 0, i = 1, mask = 2; i < 16; ++i, mask <<= 1) |
578 | if ((mask & possible) && (request_irq(i, &probe_intr, 0, "NCR-probe", NULL) == 0)) | 578 | if ((mask & possible) && (request_irq(i, &probe_intr, 0, "NCR-probe", NULL) == 0)) |
579 | trying_irqs |= mask; | 579 | trying_irqs |= mask; |
580 | 580 | ||
581 | timeout = jiffies + (250 * HZ / 1000); | 581 | timeout = jiffies + (250 * HZ / 1000); |
582 | probe_irq = SCSI_IRQ_NONE; | 582 | probe_irq = NO_IRQ; |
583 | 583 | ||
584 | /* | 584 | /* |
585 | * A interrupt is triggered whenever BSY = false, SEL = true | 585 | * A interrupt is triggered whenever BSY = false, SEL = true |
@@ -596,13 +596,13 @@ static int __init __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance, | |||
596 | NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask); | 596 | NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask); |
597 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA | ICR_ASSERT_SEL); | 597 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA | ICR_ASSERT_SEL); |
598 | 598 | ||
599 | while (probe_irq == SCSI_IRQ_NONE && time_before(jiffies, timeout)) | 599 | while (probe_irq == NO_IRQ && time_before(jiffies, timeout)) |
600 | schedule_timeout_uninterruptible(1); | 600 | schedule_timeout_uninterruptible(1); |
601 | 601 | ||
602 | NCR5380_write(SELECT_ENABLE_REG, 0); | 602 | NCR5380_write(SELECT_ENABLE_REG, 0); |
603 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); | 603 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); |
604 | 604 | ||
605 | for (i = 0, mask = 1; i < 16; ++i, mask <<= 1) | 605 | for (i = 1, mask = 2; i < 16; ++i, mask <<= 1) |
606 | if (trying_irqs & mask) | 606 | if (trying_irqs & mask) |
607 | free_irq(i, NULL); | 607 | free_irq(i, NULL); |
608 | 608 | ||
@@ -730,7 +730,7 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m, | |||
730 | 730 | ||
731 | SPRINTF("\nBase Addr: 0x%05lX ", (long) instance->base); | 731 | SPRINTF("\nBase Addr: 0x%05lX ", (long) instance->base); |
732 | SPRINTF("io_port: %04x ", (int) instance->io_port); | 732 | SPRINTF("io_port: %04x ", (int) instance->io_port); |
733 | if (instance->irq == SCSI_IRQ_NONE) | 733 | if (instance->irq == NO_IRQ) |
734 | SPRINTF("IRQ: None.\n"); | 734 | SPRINTF("IRQ: None.\n"); |
735 | else | 735 | else |
736 | SPRINTF("IRQ: %d.\n", instance->irq); | 736 | SPRINTF("IRQ: %d.\n", instance->irq); |
@@ -1501,7 +1501,7 @@ part2: | |||
1501 | } | 1501 | } |
1502 | 1502 | ||
1503 | dprintk(NDEBUG_SELECTION, "scsi%d : target %d selected, going into MESSAGE OUT phase.\n", instance->host_no, cmd->device->id); | 1503 | dprintk(NDEBUG_SELECTION, "scsi%d : target %d selected, going into MESSAGE OUT phase.\n", instance->host_no, cmd->device->id); |
1504 | tmp[0] = IDENTIFY(((instance->irq == SCSI_IRQ_NONE) ? 0 : 1), cmd->device->lun); | 1504 | tmp[0] = IDENTIFY(((instance->irq == NO_IRQ) ? 0 : 1), cmd->device->lun); |
1505 | 1505 | ||
1506 | len = 1; | 1506 | len = 1; |
1507 | cmd->tag = 0; | 1507 | cmd->tag = 0; |
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h index f09d560fb6b2..4b0c628952ee 100644 --- a/drivers/scsi/NCR5380.h +++ b/drivers/scsi/NCR5380.h | |||
@@ -232,12 +232,15 @@ | |||
232 | * Scsi_Host structure | 232 | * Scsi_Host structure |
233 | */ | 233 | */ |
234 | 234 | ||
235 | #define SCSI_IRQ_NONE 255 | ||
236 | #define DMA_NONE 255 | 235 | #define DMA_NONE 255 |
237 | #define IRQ_AUTO 254 | 236 | #define IRQ_AUTO 254 |
238 | #define DMA_AUTO 254 | 237 | #define DMA_AUTO 254 |
239 | #define PORT_AUTO 0xffff /* autoprobe io port for 53c400a */ | 238 | #define PORT_AUTO 0xffff /* autoprobe io port for 53c400a */ |
240 | 239 | ||
240 | #ifndef NO_IRQ | ||
241 | #define NO_IRQ 0 | ||
242 | #endif | ||
243 | |||
241 | #define FLAG_HAS_LAST_BYTE_SENT 1 /* NCR53c81 or better */ | 244 | #define FLAG_HAS_LAST_BYTE_SENT 1 /* NCR53c81 or better */ |
242 | #define FLAG_CHECK_LAST_BYTE_SENT 2 /* Only test once */ | 245 | #define FLAG_CHECK_LAST_BYTE_SENT 2 /* Only test once */ |
243 | #define FLAG_NCR53C400 4 /* NCR53c400 */ | 246 | #define FLAG_NCR53C400 4 /* NCR53c400 */ |
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c index f62cc904a47b..13d5995531fc 100644 --- a/drivers/scsi/arm/oak.c +++ b/drivers/scsi/arm/oak.c | |||
@@ -148,7 +148,7 @@ static int oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
148 | goto unreg; | 148 | goto unreg; |
149 | } | 149 | } |
150 | 150 | ||
151 | host->irq = IRQ_NONE; | 151 | host->irq = NO_IRQ; |
152 | host->n_io_port = 255; | 152 | host->n_io_port = 255; |
153 | 153 | ||
154 | NCR5380_init(host, 0); | 154 | NCR5380_init(host, 0); |
diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c index 5101328656b8..6e1960a88270 100644 --- a/drivers/scsi/dmx3191d.c +++ b/drivers/scsi/dmx3191d.c | |||
@@ -100,7 +100,7 @@ static int dmx3191d_probe_one(struct pci_dev *pdev, | |||
100 | */ | 100 | */ |
101 | printk(KERN_WARNING "dmx3191: IRQ %d not available - " | 101 | printk(KERN_WARNING "dmx3191: IRQ %d not available - " |
102 | "switching to polled mode.\n", pdev->irq); | 102 | "switching to polled mode.\n", pdev->irq); |
103 | shost->irq = SCSI_IRQ_NONE; | 103 | shost->irq = NO_IRQ; |
104 | } | 104 | } |
105 | 105 | ||
106 | pci_set_drvdata(pdev, shost); | 106 | pci_set_drvdata(pdev, shost); |
@@ -113,7 +113,8 @@ static int dmx3191d_probe_one(struct pci_dev *pdev, | |||
113 | return 0; | 113 | return 0; |
114 | 114 | ||
115 | out_free_irq: | 115 | out_free_irq: |
116 | free_irq(shost->irq, shost); | 116 | if (shost->irq != NO_IRQ) |
117 | free_irq(shost->irq, shost); | ||
117 | out_release_region: | 118 | out_release_region: |
118 | release_region(io, DMX3191D_REGION_LEN); | 119 | release_region(io, DMX3191D_REGION_LEN); |
119 | out_disable_device: | 120 | out_disable_device: |
@@ -130,7 +131,7 @@ static void dmx3191d_remove_one(struct pci_dev *pdev) | |||
130 | 131 | ||
131 | NCR5380_exit(shost); | 132 | NCR5380_exit(shost); |
132 | 133 | ||
133 | if (shost->irq != SCSI_IRQ_NONE) | 134 | if (shost->irq != NO_IRQ) |
134 | free_irq(shost->irq, shost); | 135 | free_irq(shost->irq, shost); |
135 | release_region(shost->io_port, DMX3191D_REGION_LEN); | 136 | release_region(shost->io_port, DMX3191D_REGION_LEN); |
136 | pci_disable_device(pdev); | 137 | pci_disable_device(pdev); |
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c index 43be785778d9..2971c7f0e898 100644 --- a/drivers/scsi/dtc.c +++ b/drivers/scsi/dtc.c | |||
@@ -254,31 +254,35 @@ found: | |||
254 | else | 254 | else |
255 | instance->irq = NCR5380_probe_irq(instance, DTC_IRQS); | 255 | instance->irq = NCR5380_probe_irq(instance, DTC_IRQS); |
256 | 256 | ||
257 | /* Compatibility with documented NCR5380 kernel parameters */ | ||
258 | if (instance->irq == 255) | ||
259 | instance->irq = NO_IRQ; | ||
260 | |||
257 | #ifndef DONT_USE_INTR | 261 | #ifndef DONT_USE_INTR |
258 | /* With interrupts enabled, it will sometimes hang when doing heavy | 262 | /* With interrupts enabled, it will sometimes hang when doing heavy |
259 | * reads. So better not enable them until I finger it out. */ | 263 | * reads. So better not enable them until I finger it out. */ |
260 | if (instance->irq != SCSI_IRQ_NONE) | 264 | if (instance->irq != NO_IRQ) |
261 | if (request_irq(instance->irq, dtc_intr, 0, | 265 | if (request_irq(instance->irq, dtc_intr, 0, |
262 | "dtc", instance)) { | 266 | "dtc", instance)) { |
263 | printk(KERN_ERR "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); | 267 | printk(KERN_ERR "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); |
264 | instance->irq = SCSI_IRQ_NONE; | 268 | instance->irq = NO_IRQ; |
265 | } | 269 | } |
266 | 270 | ||
267 | if (instance->irq == SCSI_IRQ_NONE) { | 271 | if (instance->irq == NO_IRQ) { |
268 | printk(KERN_WARNING "scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); | 272 | printk(KERN_WARNING "scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); |
269 | printk(KERN_WARNING "scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); | 273 | printk(KERN_WARNING "scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); |
270 | } | 274 | } |
271 | #else | 275 | #else |
272 | if (instance->irq != SCSI_IRQ_NONE) | 276 | if (instance->irq != NO_IRQ) |
273 | printk(KERN_WARNING "scsi%d : interrupts not used. Might as well not jumper it.\n", instance->host_no); | 277 | printk(KERN_WARNING "scsi%d : interrupts not used. Might as well not jumper it.\n", instance->host_no); |
274 | instance->irq = SCSI_IRQ_NONE; | 278 | instance->irq = NO_IRQ; |
275 | #endif | 279 | #endif |
276 | #if defined(DTCDEBUG) && (DTCDEBUG & DTCDEBUG_INIT) | 280 | #if defined(DTCDEBUG) && (DTCDEBUG & DTCDEBUG_INIT) |
277 | printk("scsi%d : irq = %d\n", instance->host_no, instance->irq); | 281 | printk("scsi%d : irq = %d\n", instance->host_no, instance->irq); |
278 | #endif | 282 | #endif |
279 | 283 | ||
280 | printk(KERN_INFO "scsi%d : at 0x%05X", instance->host_no, (int) instance->base); | 284 | printk(KERN_INFO "scsi%d : at 0x%05X", instance->host_no, (int) instance->base); |
281 | if (instance->irq == SCSI_IRQ_NONE) | 285 | if (instance->irq == NO_IRQ) |
282 | printk(" interrupts disabled"); | 286 | printk(" interrupts disabled"); |
283 | else | 287 | else |
284 | printk(" irq %d", instance->irq); | 288 | printk(" irq %d", instance->irq); |
@@ -350,7 +354,7 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst, | |||
350 | i = 0; | 354 | i = 0; |
351 | NCR5380_read(RESET_PARITY_INTERRUPT_REG); | 355 | NCR5380_read(RESET_PARITY_INTERRUPT_REG); |
352 | NCR5380_write(MODE_REG, MR_ENABLE_EOP_INTR | MR_DMA_MODE); | 356 | NCR5380_write(MODE_REG, MR_ENABLE_EOP_INTR | MR_DMA_MODE); |
353 | if (instance->irq == SCSI_IRQ_NONE) | 357 | if (instance->irq == NO_IRQ) |
354 | NCR5380_write(DTC_CONTROL_REG, CSR_DIR_READ); | 358 | NCR5380_write(DTC_CONTROL_REG, CSR_DIR_READ); |
355 | else | 359 | else |
356 | NCR5380_write(DTC_CONTROL_REG, CSR_DIR_READ | CSR_INT_BASE); | 360 | NCR5380_write(DTC_CONTROL_REG, CSR_DIR_READ | CSR_INT_BASE); |
@@ -401,7 +405,7 @@ static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src, | |||
401 | NCR5380_read(RESET_PARITY_INTERRUPT_REG); | 405 | NCR5380_read(RESET_PARITY_INTERRUPT_REG); |
402 | NCR5380_write(MODE_REG, MR_ENABLE_EOP_INTR | MR_DMA_MODE); | 406 | NCR5380_write(MODE_REG, MR_ENABLE_EOP_INTR | MR_DMA_MODE); |
403 | /* set direction (write) */ | 407 | /* set direction (write) */ |
404 | if (instance->irq == SCSI_IRQ_NONE) | 408 | if (instance->irq == NO_IRQ) |
405 | NCR5380_write(DTC_CONTROL_REG, 0); | 409 | NCR5380_write(DTC_CONTROL_REG, 0); |
406 | else | 410 | else |
407 | NCR5380_write(DTC_CONTROL_REG, CSR_5380_INTR); | 411 | NCR5380_write(DTC_CONTROL_REG, CSR_5380_INTR); |
@@ -440,7 +444,7 @@ static int dtc_release(struct Scsi_Host *shost) | |||
440 | { | 444 | { |
441 | NCR5380_local_declare(); | 445 | NCR5380_local_declare(); |
442 | NCR5380_setup(shost); | 446 | NCR5380_setup(shost); |
443 | if (shost->irq) | 447 | if (shost->irq != NO_IRQ) |
444 | free_irq(shost->irq, shost); | 448 | free_irq(shost->irq, shost); |
445 | NCR5380_exit(shost); | 449 | NCR5380_exit(shost); |
446 | if (shost->io_port && shost->n_io_port) | 450 | if (shost->io_port && shost->n_io_port) |
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 151e1ad8fe9f..a2b70fb4c67f 100644 --- a/drivers/scsi/g_NCR5380.c +++ b/drivers/scsi/g_NCR5380.c | |||
@@ -312,7 +312,7 @@ static int __init generic_NCR5380_detect(struct scsi_host_template *tpnt) | |||
312 | if (pnp_irq_valid(dev, 0)) | 312 | if (pnp_irq_valid(dev, 0)) |
313 | overrides[count].irq = pnp_irq(dev, 0); | 313 | overrides[count].irq = pnp_irq(dev, 0); |
314 | else | 314 | else |
315 | overrides[count].irq = SCSI_IRQ_NONE; | 315 | overrides[count].irq = NO_IRQ; |
316 | if (pnp_dma_valid(dev, 0)) | 316 | if (pnp_dma_valid(dev, 0)) |
317 | overrides[count].dma = pnp_dma(dev, 0); | 317 | overrides[count].dma = pnp_dma(dev, 0); |
318 | else | 318 | else |
@@ -432,20 +432,24 @@ static int __init generic_NCR5380_detect(struct scsi_host_template *tpnt) | |||
432 | else | 432 | else |
433 | instance->irq = NCR5380_probe_irq(instance, 0xffff); | 433 | instance->irq = NCR5380_probe_irq(instance, 0xffff); |
434 | 434 | ||
435 | if (instance->irq != SCSI_IRQ_NONE) | 435 | /* Compatibility with documented NCR5380 kernel parameters */ |
436 | if (instance->irq == 255) | ||
437 | instance->irq = NO_IRQ; | ||
438 | |||
439 | if (instance->irq != NO_IRQ) | ||
436 | if (request_irq(instance->irq, generic_NCR5380_intr, | 440 | if (request_irq(instance->irq, generic_NCR5380_intr, |
437 | 0, "NCR5380", instance)) { | 441 | 0, "NCR5380", instance)) { |
438 | printk(KERN_WARNING "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); | 442 | printk(KERN_WARNING "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); |
439 | instance->irq = SCSI_IRQ_NONE; | 443 | instance->irq = NO_IRQ; |
440 | } | 444 | } |
441 | 445 | ||
442 | if (instance->irq == SCSI_IRQ_NONE) { | 446 | if (instance->irq == NO_IRQ) { |
443 | printk(KERN_INFO "scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); | 447 | printk(KERN_INFO "scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); |
444 | printk(KERN_INFO "scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); | 448 | printk(KERN_INFO "scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); |
445 | } | 449 | } |
446 | 450 | ||
447 | printk(KERN_INFO "scsi%d : at " STRVAL(NCR5380_map_name) " 0x%x", instance->host_no, (unsigned int) instance->NCR5380_instance_name); | 451 | printk(KERN_INFO "scsi%d : at " STRVAL(NCR5380_map_name) " 0x%x", instance->host_no, (unsigned int) instance->NCR5380_instance_name); |
448 | if (instance->irq == SCSI_IRQ_NONE) | 452 | if (instance->irq == NO_IRQ) |
449 | printk(" interrupts disabled"); | 453 | printk(" interrupts disabled"); |
450 | else | 454 | else |
451 | printk(" irq %d", instance->irq); | 455 | printk(" irq %d", instance->irq); |
@@ -486,7 +490,7 @@ static int generic_NCR5380_release_resources(struct Scsi_Host *instance) | |||
486 | NCR5380_local_declare(); | 490 | NCR5380_local_declare(); |
487 | NCR5380_setup(instance); | 491 | NCR5380_setup(instance); |
488 | 492 | ||
489 | if (instance->irq != SCSI_IRQ_NONE) | 493 | if (instance->irq != NO_IRQ) |
490 | free_irq(instance->irq, instance); | 494 | free_irq(instance->irq, instance); |
491 | NCR5380_exit(instance); | 495 | NCR5380_exit(instance); |
492 | 496 | ||
@@ -796,7 +800,7 @@ static int generic_NCR5380_show_info(struct seq_file *m, struct Scsi_Host *scsi_ | |||
796 | PRINTP("NO NCR53C400 driver extensions\n"); | 800 | PRINTP("NO NCR53C400 driver extensions\n"); |
797 | #endif | 801 | #endif |
798 | PRINTP("Using %s mapping at %s 0x%lx, " ANDP STRVAL(NCR5380_map_config) ANDP STRVAL(NCR5380_map_name) ANDP scsi_ptr->NCR5380_instance_name); | 802 | PRINTP("Using %s mapping at %s 0x%lx, " ANDP STRVAL(NCR5380_map_config) ANDP STRVAL(NCR5380_map_name) ANDP scsi_ptr->NCR5380_instance_name); |
799 | if (scsi_ptr->irq == SCSI_IRQ_NONE) | 803 | if (scsi_ptr->irq == NO_IRQ) |
800 | PRINTP("no interrupt\n"); | 804 | PRINTP("no interrupt\n"); |
801 | else | 805 | else |
802 | PRINTP("on interrupt %d\n" ANDP scsi_ptr->irq); | 806 | PRINTP("on interrupt %d\n" ANDP scsi_ptr->irq); |
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c index 4dec06da3f34..5d8d75c619cd 100644 --- a/drivers/scsi/mac_scsi.c +++ b/drivers/scsi/mac_scsi.c | |||
@@ -229,15 +229,15 @@ int __init macscsi_detect(struct scsi_host_template * tpnt) | |||
229 | 229 | ||
230 | instance->n_io_port = 255; | 230 | instance->n_io_port = 255; |
231 | 231 | ||
232 | if (instance->irq != SCSI_IRQ_NONE) | 232 | if (instance->irq != NO_IRQ) |
233 | if (request_irq(instance->irq, NCR5380_intr, 0, "ncr5380", instance)) { | 233 | if (request_irq(instance->irq, NCR5380_intr, 0, "ncr5380", instance)) { |
234 | printk(KERN_WARNING "scsi%d: IRQ%d not free, interrupts disabled\n", | 234 | printk(KERN_WARNING "scsi%d: IRQ%d not free, interrupts disabled\n", |
235 | instance->host_no, instance->irq); | 235 | instance->host_no, instance->irq); |
236 | instance->irq = SCSI_IRQ_NONE; | 236 | instance->irq = NO_IRQ; |
237 | } | 237 | } |
238 | 238 | ||
239 | printk(KERN_INFO "scsi%d: generic 5380 at port %lX irq", instance->host_no, instance->io_port); | 239 | printk(KERN_INFO "scsi%d: generic 5380 at port %lX irq", instance->host_no, instance->io_port); |
240 | if (instance->irq == SCSI_IRQ_NONE) | 240 | if (instance->irq == NO_IRQ) |
241 | printk (KERN_INFO "s disabled"); | 241 | printk (KERN_INFO "s disabled"); |
242 | else | 242 | else |
243 | printk (KERN_INFO " %d", instance->irq); | 243 | printk (KERN_INFO " %d", instance->irq); |
@@ -252,7 +252,7 @@ int __init macscsi_detect(struct scsi_host_template * tpnt) | |||
252 | 252 | ||
253 | int macscsi_release (struct Scsi_Host *shpnt) | 253 | int macscsi_release (struct Scsi_Host *shpnt) |
254 | { | 254 | { |
255 | if (shpnt->irq != SCSI_IRQ_NONE) | 255 | if (shpnt->irq != NO_IRQ) |
256 | free_irq(shpnt->irq, shpnt); | 256 | free_irq(shpnt->irq, shpnt); |
257 | NCR5380_exit(shpnt); | 257 | NCR5380_exit(shpnt); |
258 | 258 | ||
diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c index 3e40479ebb48..3782091f82cb 100644 --- a/drivers/scsi/pas16.c +++ b/drivers/scsi/pas16.c | |||
@@ -62,13 +62,11 @@ | |||
62 | * If you have problems with your card not being recognized, use | 62 | * If you have problems with your card not being recognized, use |
63 | * the LILO command line override. Try to get it recognized without | 63 | * the LILO command line override. Try to get it recognized without |
64 | * interrupts. Ie, for a board at the default 0x388 base port, | 64 | * interrupts. Ie, for a board at the default 0x388 base port, |
65 | * boot: linux pas16=0x388,255 | 65 | * boot: linux pas16=0x388,0 |
66 | * | 66 | * |
67 | * SCSI_IRQ_NONE (255) should be specified for no interrupt, | 67 | * NO_IRQ (0) should be specified for no interrupt, |
68 | * IRQ_AUTO (254) to autoprobe for an IRQ line if overridden | 68 | * IRQ_AUTO (254) to autoprobe for an IRQ line if overridden |
69 | * on the command line. | 69 | * on the command line. |
70 | * | ||
71 | * (IRQ_AUTO == 254, SCSI_IRQ_NONE == 255 in NCR5380.h) | ||
72 | */ | 70 | */ |
73 | 71 | ||
74 | #include <linux/module.h> | 72 | #include <linux/module.h> |
@@ -416,15 +414,19 @@ static int __init pas16_detect(struct scsi_host_template *tpnt) | |||
416 | else | 414 | else |
417 | instance->irq = NCR5380_probe_irq(instance, PAS16_IRQS); | 415 | instance->irq = NCR5380_probe_irq(instance, PAS16_IRQS); |
418 | 416 | ||
419 | if (instance->irq != SCSI_IRQ_NONE) | 417 | /* Compatibility with documented NCR5380 kernel parameters */ |
418 | if (instance->irq == 255) | ||
419 | instance->irq = NO_IRQ; | ||
420 | |||
421 | if (instance->irq != NO_IRQ) | ||
420 | if (request_irq(instance->irq, pas16_intr, 0, | 422 | if (request_irq(instance->irq, pas16_intr, 0, |
421 | "pas16", instance)) { | 423 | "pas16", instance)) { |
422 | printk("scsi%d : IRQ%d not free, interrupts disabled\n", | 424 | printk("scsi%d : IRQ%d not free, interrupts disabled\n", |
423 | instance->host_no, instance->irq); | 425 | instance->host_no, instance->irq); |
424 | instance->irq = SCSI_IRQ_NONE; | 426 | instance->irq = NO_IRQ; |
425 | } | 427 | } |
426 | 428 | ||
427 | if (instance->irq == SCSI_IRQ_NONE) { | 429 | if (instance->irq == NO_IRQ) { |
428 | printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); | 430 | printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); |
429 | printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); | 431 | printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); |
430 | /* Disable 5380 interrupts, leave drive params the same */ | 432 | /* Disable 5380 interrupts, leave drive params the same */ |
@@ -438,7 +440,7 @@ static int __init pas16_detect(struct scsi_host_template *tpnt) | |||
438 | 440 | ||
439 | printk("scsi%d : at 0x%04x", instance->host_no, (int) | 441 | printk("scsi%d : at 0x%04x", instance->host_no, (int) |
440 | instance->io_port); | 442 | instance->io_port); |
441 | if (instance->irq == SCSI_IRQ_NONE) | 443 | if (instance->irq == NO_IRQ) |
442 | printk (" interrupts disabled"); | 444 | printk (" interrupts disabled"); |
443 | else | 445 | else |
444 | printk (" irq %d", instance->irq); | 446 | printk (" irq %d", instance->irq); |
@@ -568,7 +570,7 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src | |||
568 | 570 | ||
569 | static int pas16_release(struct Scsi_Host *shost) | 571 | static int pas16_release(struct Scsi_Host *shost) |
570 | { | 572 | { |
571 | if (shost->irq) | 573 | if (shost->irq != NO_IRQ) |
572 | free_irq(shost->irq, shost); | 574 | free_irq(shost->irq, shost); |
573 | NCR5380_exit(shost); | 575 | NCR5380_exit(shost); |
574 | if (shost->io_port && shost->n_io_port) | 576 | if (shost->io_port && shost->n_io_port) |
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) | |||
278 | #ifndef REAL_DMA | 278 | #ifndef REAL_DMA |
279 | printk("scsi%d: IRQ%d not free, interrupts disabled\n", | 279 | printk("scsi%d: IRQ%d not free, interrupts disabled\n", |
280 | instance->host_no, instance->irq); | 280 | instance->host_no, instance->irq); |
281 | instance->irq = SCSI_IRQ_NONE; | 281 | instance->irq = NO_IRQ; |
282 | #else | 282 | #else |
283 | printk("scsi%d: IRQ%d not free, bailing out\n", | 283 | printk("scsi%d: IRQ%d not free, bailing out\n", |
284 | instance->host_no, instance->irq); | 284 | instance->host_no, instance->irq); |
@@ -288,7 +288,7 @@ static int __init sun3scsi_detect(struct scsi_host_template *tpnt) | |||
288 | 288 | ||
289 | pr_info("scsi%d: %s at port %lX irq", instance->host_no, | 289 | pr_info("scsi%d: %s at port %lX irq", instance->host_no, |
290 | tpnt->proc_name, instance->io_port); | 290 | tpnt->proc_name, instance->io_port); |
291 | if (instance->irq == SCSI_IRQ_NONE) | 291 | if (instance->irq == NO_IRQ) |
292 | printk ("s disabled"); | 292 | printk ("s disabled"); |
293 | else | 293 | else |
294 | printk (" %d", instance->irq); | 294 | printk (" %d", instance->irq); |
@@ -325,7 +325,7 @@ static int __init sun3scsi_detect(struct scsi_host_template *tpnt) | |||
325 | 325 | ||
326 | static int sun3scsi_release(struct Scsi_Host *shpnt) | 326 | static int sun3scsi_release(struct Scsi_Host *shpnt) |
327 | { | 327 | { |
328 | if (shpnt->irq != SCSI_IRQ_NONE) | 328 | if (shpnt->irq != NO_IRQ) |
329 | free_irq(shpnt->irq, shpnt); | 329 | free_irq(shpnt->irq, shpnt); |
330 | 330 | ||
331 | iounmap((void *)sun3_scsi_regp); | 331 | iounmap((void *)sun3_scsi_regp); |
diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c index 6220dee8b697..ad833689b311 100644 --- a/drivers/scsi/t128.c +++ b/drivers/scsi/t128.c | |||
@@ -228,15 +228,19 @@ found: | |||
228 | else | 228 | else |
229 | instance->irq = NCR5380_probe_irq(instance, T128_IRQS); | 229 | instance->irq = NCR5380_probe_irq(instance, T128_IRQS); |
230 | 230 | ||
231 | if (instance->irq != SCSI_IRQ_NONE) | 231 | /* Compatibility with documented NCR5380 kernel parameters */ |
232 | if (instance->irq == 255) | ||
233 | instance->irq = NO_IRQ; | ||
234 | |||
235 | if (instance->irq != NO_IRQ) | ||
232 | if (request_irq(instance->irq, t128_intr, 0, "t128", | 236 | if (request_irq(instance->irq, t128_intr, 0, "t128", |
233 | instance)) { | 237 | instance)) { |
234 | printk("scsi%d : IRQ%d not free, interrupts disabled\n", | 238 | printk("scsi%d : IRQ%d not free, interrupts disabled\n", |
235 | instance->host_no, instance->irq); | 239 | instance->host_no, instance->irq); |
236 | instance->irq = SCSI_IRQ_NONE; | 240 | instance->irq = NO_IRQ; |
237 | } | 241 | } |
238 | 242 | ||
239 | if (instance->irq == SCSI_IRQ_NONE) { | 243 | if (instance->irq == NO_IRQ) { |
240 | printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); | 244 | printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); |
241 | printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); | 245 | printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); |
242 | } | 246 | } |
@@ -246,7 +250,7 @@ found: | |||
246 | #endif | 250 | #endif |
247 | 251 | ||
248 | printk("scsi%d : at 0x%08lx", instance->host_no, instance->base); | 252 | printk("scsi%d : at 0x%08lx", instance->host_no, instance->base); |
249 | if (instance->irq == SCSI_IRQ_NONE) | 253 | if (instance->irq == NO_IRQ) |
250 | printk (" interrupts disabled"); | 254 | printk (" interrupts disabled"); |
251 | else | 255 | else |
252 | printk (" irq %d", instance->irq); | 256 | printk (" irq %d", instance->irq); |
@@ -265,7 +269,7 @@ static int t128_release(struct Scsi_Host *shost) | |||
265 | { | 269 | { |
266 | NCR5380_local_declare(); | 270 | NCR5380_local_declare(); |
267 | NCR5380_setup(shost); | 271 | NCR5380_setup(shost); |
268 | if (shost->irq) | 272 | if (shost->irq != NO_IRQ) |
269 | free_irq(shost->irq, shost); | 273 | free_irq(shost->irq, shost); |
270 | NCR5380_exit(shost); | 274 | NCR5380_exit(shost); |
271 | if (shost->io_port && shost->n_io_port) | 275 | if (shost->io_port && shost->n_io_port) |