linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Don't get PCI IRQ from OF for devices with no IRQ
@ 2006-10-05  6:40 Benjamin Herrenschmidt
  2006-10-08  9:42 ` Olaf Hering
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2006-10-05  6:40 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

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>

Index: linux-work/arch/powerpc/kernel/prom_parse.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/prom_parse.c	2006-10-03 12:41:03.000000000 +1000
+++ linux-work/arch/powerpc/kernel/prom_parse.c	2006-10-05 16:33:25.000000000 +1000
@@ -914,6 +914,17 @@ int of_irq_map_pci(struct pci_dev *pdev,
 	u8 pin;
 	int rc;
 
+	/* We need to first check if the PCI device has a PCI interrupt at all
+	 * since we have cases where the device-node might expose non-PCI
+	 * interrupts, but the device has no PCI interrupt to it
+	 */
+	rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
+	if (rc != 0)
+		return rc;
+	/* No pin, exit */
+	if (pin == 0)
+		return -ENODEV;
+
 	/* Check if we have a device node, if yes, fallback to standard OF
 	 * parsing
 	 */
@@ -925,12 +936,6 @@ int of_irq_map_pci(struct pci_dev *pdev,
 	 * interrupt spec.  we assume #interrupt-cells is 1, which is standard
 	 * for PCI. If you do different, then don't use that routine.
 	 */
-	rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
-	if (rc != 0)
-		return rc;
-	/* No pin, exit */
-	if (pin == 0)
-		return -ENODEV;
 
 	/* Now we walk up the PCI tree */
 	lspec = pin;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc: Don't get PCI IRQ from OF for devices with no IRQ
  2006-10-05  6:40 [PATCH] powerpc: Don't get PCI IRQ from OF for devices with no IRQ Benjamin Herrenschmidt
@ 2006-10-08  9:42 ` Olaf Hering
  0 siblings, 0 replies; 2+ messages in thread
From: Olaf Hering @ 2006-10-08  9:42 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, Paul Mackerras

On Thu, Oct 05, Benjamin Herrenschmidt wrote:

> 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.

This breaks at least G5, IDE is probed twice, the first try uses IRQ 0.
SATA doesnt get an interrupt either.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-08  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-05  6:40 [PATCH] powerpc: Don't get PCI IRQ from OF for devices with no IRQ Benjamin Herrenschmidt
2006-10-08  9:42 ` Olaf Hering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).