Commit 02ab55b8 authored by Linus Torvalds's avatar Linus Torvalds

Fix up the IDE irq disable to take into account some

odd-ball IDE controllers without a control register.

(Apparently Amiga X-Surf and Amiga Gayle with IDE doubler)

Also, clean up the code a bit while I'm at it.
parent 69766ad7
......@@ -385,19 +385,21 @@ static int try_to_identify (ide_drive_t *drive, u8 cmd)
int autoprobe = 0;
unsigned long cookie = 0;
if (IDE_CONTROL_REG && !hwif->irq) {
autoprobe = 1;
cookie = probe_irq_on();
/* enable device irq */
hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
} else {
/*
* Disable device irq if we don't need to
* Disable device irq unless we need to
* probe for it. Otherwise we'll get spurious
* interrupts during the identify-phase that
* the irq handler isn't expecting.
*/
hwif->OUTB(drive->ctl|2, IDE_CONTROL_REG);
if (IDE_CONTROL_REG) {
u8 ctl = drive->ctl | 2;
if (!hwif->irq) {
autoprobe = 1;
cookie = probe_irq_on();
/* enable device irq */
ctl &= ~2;
}
hwif->OUTB(ctl, IDE_CONTROL_REG);
}
retval = actual_try_to_identify(drive, cmd);
......
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