diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-10-05 02:40:41 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-10-06 07:10:41 -0400 |
commit | 41550c5128150175197257b6ceab2cd50dea7b51 (patch) | |
tree | 9406c5680e5e7fd49804fe95104453b272533f28 /arch | |
parent | c998de146061db17787c1a31a3db1989f1341fdf (diff) |
[POWERPC] Don't get PCI IRQ from OF for devices with no IRQ
This patch adds checking of the PCI_INTERRUPT_PIN register before
using standard OF parsing to retreive PCI interrupts. The reason is
that some PCI devices may have no PCI interrupt, though they may have
interrupts attached via other means. In this case, we shall not use
irq->pdev, but device-specific code can later retreive those interrupts
instead.
Without that patch, Maple and derivatives don't get the right interrupt
for the second IDE channel as the linux IDE code fallsback to the PCI
irq instead of trying to use the legacy ones for the on-board controller
(which has no PCI_INTERRUPT_PIN). Having no PCI IRQ assign to it (as it
doesn't request any) fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/prom_parse.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index 603dff3ad62a..17fcb4842fe5 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c | |||
@@ -914,6 +914,17 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) | |||
914 | u8 pin; | 914 | u8 pin; |
915 | int rc; | 915 | int rc; |
916 | 916 | ||
917 | /* We need to first check if the PCI device has a PCI interrupt at all | ||
918 | * since we have cases where the device-node might expose non-PCI | ||
919 | * interrupts, but the device has no PCI interrupt to it | ||
920 | */ | ||
921 | rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); | ||
922 | if (rc != 0) | ||
923 | return rc; | ||
924 | /* No pin, exit */ | ||
925 | if (pin == 0) | ||
926 | return -ENODEV; | ||
927 | |||
917 | /* Check if we have a device node, if yes, fallback to standard OF | 928 | /* Check if we have a device node, if yes, fallback to standard OF |
918 | * parsing | 929 | * parsing |
919 | */ | 930 | */ |
@@ -925,12 +936,6 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) | |||
925 | * interrupt spec. we assume #interrupt-cells is 1, which is standard | 936 | * interrupt spec. we assume #interrupt-cells is 1, which is standard |
926 | * for PCI. If you do different, then don't use that routine. | 937 | * for PCI. If you do different, then don't use that routine. |
927 | */ | 938 | */ |
928 | rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); | ||
929 | if (rc != 0) | ||
930 | return rc; | ||
931 | /* No pin, exit */ | ||
932 | if (pin == 0) | ||
933 | return -ENODEV; | ||
934 | 939 | ||
935 | /* Now we walk up the PCI tree */ | 940 | /* Now we walk up the PCI tree */ |
936 | lspec = pin; | 941 | lspec = pin; |