From 13c7e0d4e2ce165522a9dcca18bff380912dbfe5 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sun, 15 Sep 2002 18:23:58 -0700 Subject: [PATCH] [PATCH] ide irq problem Attribution goes to Petr Vandrovec for finding and solving this one. You probably read the mail you were cc'ed on, so I'll just mention that this patch makes sure that the irq disabling and enabling is perfectly balanced in the probing path. I've also looked at the multiple irq chain problem you mentioned, and as far as I can see we are never touching the 2nd chain from within the first one. So should be ok. I'm also including the unexpected interrupt prinkt removal. --- drivers/ide/ide-probe.c | 16 +++++++++++++--- drivers/ide/ide.c | 1 - 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 27b8620c92ab..1eb22170542e 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -592,6 +592,7 @@ void probe_hwif (ide_hwif_t *hwif) { unsigned int unit; unsigned long flags; + unsigned int irqd; if (hwif->noprobe) return; @@ -623,7 +624,12 @@ void probe_hwif (ide_hwif_t *hwif) return; } - if (hwif->hw.ack_intr && hwif->irq) + /* + * We must always disable IRQ, as probe_for_drive will assert IRQ, but + * we'll install our IRQ driver much later... + */ + irqd = hwif->irq; + if (irqd) disable_irq(hwif->irq); local_irq_set(flags); @@ -659,8 +665,12 @@ void probe_hwif (ide_hwif_t *hwif) } local_irq_restore(flags); - if (hwif->hw.ack_intr && hwif->irq) - enable_irq(hwif->irq); + /* + * Use cached IRQ number. It might be (and is...) changed by probe + * code above + */ + if (irqd) + enable_irq(irqd); for (unit = 0; unit < MAX_DRIVES; ++unit) { ide_drive_t *drive = &hwif->drives[unit]; diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 78b2998a70c3..e2014e35718e 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -1378,7 +1378,6 @@ void ide_intr (int irq, void *dev_id, struct pt_regs *regs) if ((handler = hwgroup->handler) == NULL || hwgroup->poll_timeout != 0) { - printk("ide_intr: unexpected interrupt!\n"); /* * Not expecting an interrupt from this drive. * That means this could be: -- 2.39.5