[RESEND][PATCH] Fix PCI<->OF matching on G5 AGP bus

From: Benjamin Herrenschmidt
Date: Tue Mar 09 2004 - 21:32:48 EST

(I noticed more recent patches got in while this one didn't, just
re-sending this one in case it went unnoticed :)


Strangely, I though I fixed that a long time ago, but it was still
broken in the current tree... So drivers like radeonfb fail to
find the OF device matching a given PCI device on the G5 AGP bus
because of some bus renumbering tricks. This patch fixes the
problem by fixing the bus numbers in the OF node. This corrects
radeonfb and other drivers looking for EDID / PLL datas in the
OF node.

===== arch/ppc64/kernel/pmac_pci.c 1.3 vs edited =====
--- 1.3/arch/ppc64/kernel/pmac_pci.c Mon Mar 1 11:50:37 2004
+++ edited/arch/ppc64/kernel/pmac_pci.c Tue Mar 9 20:20:53 2004
@@ -719,6 +719,17 @@
/* Setup the linkage between OF nodes and PHBs */

+ /* Fixup the PCI<->OF mapping for U3 AGP due to bus renumbering. We
+ * assume there is no P2P bridge on the AGP bus, which should be a
+ * safe assumptions hopefully.
+ */
+ if (u3_agp) {
+ struct device_node *np = u3_agp->arch_data;
+ np->busno = 0xf0;
+ for (np = np->child; np; np = np->sibling)
+ np->busno = 0xf0;
+ }

/* Tell pci.c to use the common resource allocation mecanism */

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/