diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-06-23 06:43:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-24 03:32:30 -0400 |
commit | ffc36c7610731115c77700dcc53901920361c235 (patch) | |
tree | c300ea91a72c166c6e9d10a6526b29514d3956ce /drivers | |
parent | e01698aed04811b9a9c4f8d54b73cb182757063d (diff) |
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: Frans Pop <elendil@planet.nl>
Tested-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide-probe.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 51af4eea0d36..1bb106f6221a 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -818,6 +818,24 @@ static int ide_port_setup_devices(ide_hwif_t *hwif) | |||
818 | return j; | 818 | return j; |
819 | } | 819 | } |
820 | 820 | ||
821 | static void ide_host_enable_irqs(struct ide_host *host) | ||
822 | { | ||
823 | ide_hwif_t *hwif; | ||
824 | int i; | ||
825 | |||
826 | ide_host_for_each_port(i, hwif, host) { | ||
827 | if (hwif == NULL) | ||
828 | continue; | ||
829 | |||
830 | /* clear any pending IRQs */ | ||
831 | hwif->tp_ops->read_status(hwif); | ||
832 | |||
833 | /* unmask IRQs */ | ||
834 | if (hwif->io_ports.ctl_addr) | ||
835 | hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS); | ||
836 | } | ||
837 | } | ||
838 | |||
821 | /* | 839 | /* |
822 | * This routine sets up the IRQ for an IDE interface. | 840 | * This routine sets up the IRQ for an IDE interface. |
823 | */ | 841 | */ |
@@ -831,9 +849,6 @@ static int init_irq (ide_hwif_t *hwif) | |||
831 | if (irq_handler == NULL) | 849 | if (irq_handler == NULL) |
832 | irq_handler = ide_intr; | 850 | irq_handler = ide_intr; |
833 | 851 | ||
834 | if (io_ports->ctl_addr) | ||
835 | hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS); | ||
836 | |||
837 | if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif)) | 852 | if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif)) |
838 | goto out_up; | 853 | goto out_up; |
839 | 854 | ||
@@ -1404,6 +1419,8 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d, | |||
1404 | ide_port_tune_devices(hwif); | 1419 | ide_port_tune_devices(hwif); |
1405 | } | 1420 | } |
1406 | 1421 | ||
1422 | ide_host_enable_irqs(host); | ||
1423 | |||
1407 | ide_host_for_each_port(i, hwif, host) { | 1424 | ide_host_for_each_port(i, hwif, host) { |
1408 | if (hwif == NULL) | 1425 | if (hwif == NULL) |
1409 | continue; | 1426 | continue; |