Commit f1918f35 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] fix all the IRQ breakage on the in2000

parent 7182182f
...@@ -832,7 +832,7 @@ int i; ...@@ -832,7 +832,7 @@ int i;
static void in2000_intr (int irqnum, void * dev_id, struct pt_regs *ptregs) static void in2000_intr (int irqnum, void * dev_id, struct pt_regs *ptregs)
{ {
struct Scsi_Host *instance; struct Scsi_Host *instance = dev_id;
struct IN2000_hostdata *hostdata; struct IN2000_hostdata *hostdata;
Scsi_Cmnd *patch, *cmd; Scsi_Cmnd *patch, *cmd;
uchar asr, sr, phs, id, lun, *ucp, msg; uchar asr, sr, phs, id, lun, *ucp, msg;
...@@ -842,14 +842,6 @@ unsigned short *sp; ...@@ -842,14 +842,6 @@ unsigned short *sp;
unsigned short f; unsigned short f;
unsigned long flags; unsigned long flags;
for (instance = instance_list; instance; instance = instance->next) {
if (instance->irq == irqnum)
break;
}
if (!instance) {
printk("*** Hmm... interrupts are screwed up! ***\n");
return;
}
hostdata = (struct IN2000_hostdata *)instance->hostdata; hostdata = (struct IN2000_hostdata *)instance->hostdata;
/* Get the spin_lock and disable further ints, for SMP */ /* Get the spin_lock and disable further ints, for SMP */
...@@ -2046,7 +2038,7 @@ char buf[32]; ...@@ -2046,7 +2038,7 @@ char buf[32];
write1_io(0,IO_FIFO_READ); /* start fifo out in read mode */ write1_io(0,IO_FIFO_READ); /* start fifo out in read mode */
write1_io(0,IO_INTR_MASK); /* allow all ints */ write1_io(0,IO_INTR_MASK); /* allow all ints */
x = int_tab[(switches & (SW_INT0 | SW_INT1)) >> SW_INT_SHIFT]; x = int_tab[(switches & (SW_INT0 | SW_INT1)) >> SW_INT_SHIFT];
if (request_irq(x, in2000_intr, SA_INTERRUPT, "in2000", NULL)) { if (request_irq(x, in2000_intr, SA_INTERRUPT, "in2000", instance)) {
printk("in2000_detect: Unable to allocate IRQ.\n"); printk("in2000_detect: Unable to allocate IRQ.\n");
detect_count--; detect_count--;
continue; continue;
...@@ -2163,6 +2155,15 @@ char buf[32]; ...@@ -2163,6 +2155,15 @@ char buf[32];
return detect_count; return detect_count;
} }
static int in2000_release(struct Scsi_Host *shost)
{
if (shost->irq)
free_irq(shost->irq, shost);
if (shost->io_port && shost->n_io_port)
release_region(shost->io_port, shost->n_io_port);
return 0;
}
/* NOTE: I lifted this function straight out of the old driver, /* NOTE: I lifted this function straight out of the old driver,
* and have not tested it. Presumably it does what it's * and have not tested it. Presumably it does what it's
...@@ -2215,10 +2216,7 @@ Scsi_Cmnd *cmd; ...@@ -2215,10 +2216,7 @@ Scsi_Cmnd *cmd;
int x,i; int x,i;
static int stop = 0; static int stop = 0;
for (instance=instance_list; instance; instance=instance->next) { instance = scsi_host_hn_get(hn);
if (instance->host_no == hn)
break;
}
if (!instance) { if (!instance) {
printk("*** Hmm... Can't find host #%d!\n",hn); printk("*** Hmm... Can't find host #%d!\n",hn);
return (-ESRCH); return (-ESRCH);
......
...@@ -417,6 +417,7 @@ static int in2000_device_reset(Scsi_Cmnd *); ...@@ -417,6 +417,7 @@ static int in2000_device_reset(Scsi_Cmnd *);
proc_info: in2000_proc_info, /* pointer to proc info function */ \ proc_info: in2000_proc_info, /* pointer to proc info function */ \
name: "Always IN2000", /* device name */ \ name: "Always IN2000", /* device name */ \
detect: in2000_detect, /* returns number of in2000's found */ \ detect: in2000_detect, /* returns number of in2000's found */ \
release: in2000_release, /* release the in2000 controller */ \
queuecommand: in2000_queuecommand, /* queue scsi command, don't wait */ \ queuecommand: in2000_queuecommand, /* queue scsi command, don't wait */ \
eh_abort_handler: in2000_abort, /* abort current command */ \ eh_abort_handler: in2000_abort, /* abort current command */ \
eh_bus_reset_handler: in2000_bus_reset, /* reset scsi bus */ \ eh_bus_reset_handler: in2000_bus_reset, /* reset scsi bus */ \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment