Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc: Fix device-tree matching for Apple U4 bridge

Apple Quad G5 has some oddity in it's device-tree which causes the new
generic matching code to fail to relate nodes for PCI-E devices below U4
with their respective struct pci_dev. This breaks graphics on those
machines among others.

This fixes it using a quirk which copies the node pointer from the host
bridge for the root complex, which makes the generic code work for the
children afterward.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Benjamin Herrenschmidt and committed by
Linus Torvalds
16fa42af b0f84374

+14
+14
arch/powerpc/platforms/powermac/pci.c
··· 561 561 .write = u4_pcie_write_config, 562 562 }; 563 563 564 + static void __devinit pmac_pci_fixup_u4_of_node(struct pci_dev *dev) 565 + { 566 + /* Apple's device-tree "hides" the root complex virtual P2P bridge 567 + * on U4. However, Linux sees it, causing the PCI <-> OF matching 568 + * code to fail to properly match devices below it. This works around 569 + * it by setting the node of the bridge to point to the PHB node, 570 + * which is not entirely correct but fixes the matching code and 571 + * doesn't break anything else. It's also the simplest possible fix. 572 + */ 573 + if (dev->dev.of_node == NULL) 574 + dev->dev.of_node = pcibios_get_phb_of_node(dev->bus); 575 + } 576 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, 0x5b, pmac_pci_fixup_u4_of_node); 577 + 564 578 #endif /* CONFIG_PPC64 */ 565 579 566 580 #ifdef CONFIG_PPC32