提交 ffc36c76 编写于 作者: B Bartlomiej Zolnierkiewicz 提交者: David S. Miller

ide: fix handling of unexpected IRQs vs request_irq()

Add ide_host_enable_irqs() helper and use it in ide_host_register()
before registering ports.  Then remove no longer needed IRQ unmasking
from in init_irq().

This should fix the problem with "screaming" shared IRQ on the first
port (after request_irq() call while we have the unexpected IRQ pending
on the second port) which was uncovered by my rework of the serialized
interfaces support.
Reported-by: NFrans Pop <elendil@planet.nl>
Tested-by: NFrans Pop <elendil@planet.nl>
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e01698ae
...@@ -818,6 +818,24 @@ static int ide_port_setup_devices(ide_hwif_t *hwif) ...@@ -818,6 +818,24 @@ static int ide_port_setup_devices(ide_hwif_t *hwif)
return j; return j;
} }
static void ide_host_enable_irqs(struct ide_host *host)
{
ide_hwif_t *hwif;
int i;
ide_host_for_each_port(i, hwif, host) {
if (hwif == NULL)
continue;
/* clear any pending IRQs */
hwif->tp_ops->read_status(hwif);
/* unmask IRQs */
if (hwif->io_ports.ctl_addr)
hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
}
}
/* /*
* This routine sets up the IRQ for an IDE interface. * This routine sets up the IRQ for an IDE interface.
*/ */
...@@ -831,9 +849,6 @@ static int init_irq (ide_hwif_t *hwif) ...@@ -831,9 +849,6 @@ static int init_irq (ide_hwif_t *hwif)
if (irq_handler == NULL) if (irq_handler == NULL)
irq_handler = ide_intr; irq_handler = ide_intr;
if (io_ports->ctl_addr)
hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif)) if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
goto out_up; goto out_up;
...@@ -1404,6 +1419,8 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d, ...@@ -1404,6 +1419,8 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
ide_port_tune_devices(hwif); ide_port_tune_devices(hwif);
} }
ide_host_enable_irqs(host);
ide_host_for_each_port(i, hwif, host) { ide_host_for_each_port(i, hwif, host) {
if (hwif == NULL) if (hwif == NULL)
continue; continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册