From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Sun, 6 Nov 2011 18:56:00 +0000 (+0000)
Subject: powerpc/powernv: Fixup p7ioc PCIe root complex class code
X-Git-Tag: firefly_0821_release~3680^2~3833^2~65
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ca45cfe31ee5b59eb2e0f19baac575a4f5b68537;p=firefly-linux-kernel-4.4.55.git

powerpc/powernv: Fixup p7ioc PCIe root complex class code

It advertises "host bridge" instead of "PCI to PCI bridge" which confuses
the Linux probe code.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index 8b90d945399a..baef772d41f4 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -416,6 +416,13 @@ static void __devinit pnv_pci_dma_dev_setup(struct pci_dev *pdev)
 		pnv_pci_dma_fallback_setup(hose, pdev);
 }
 
+/* Fixup wrong class code in p7ioc root complex */
+static void __devinit pnv_p7ioc_rc_quirk(struct pci_dev *dev)
+{
+	dev->class = PCI_CLASS_BRIDGE_PCI << 8;
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IBM, 0x3b9, pnv_p7ioc_rc_quirk);
+
 static int pnv_pci_probe_mode(struct pci_bus *bus)
 {
 	struct pci_controller *hose = pci_bus_to_host(bus);