Message ID | 20171130224243.GB19640@bhelgaas-glaptop.roam.corp.google.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
Hello Bjorn Firstly sorry for not being able to join in this discussion, I have been moving house and only got my X1000 set up again yesterday.. On 30/11/2017, Bjorn Helgaas wrote: > I *think* something like the patch below should make this work if you > use the "pci=pcie_scan_all" parameter. We have some x86 DMI quirks > that set PCI_SCAN_ALL_PCIE_DEVS automatically. I don't know how to do > something similar on powerpc, but maybe you do? Actually the root ports on the Nemo's PA6T processor don't respond to the SB600 unless we turn on a special 'relax pci-e' bit in one of its control registers. We use a small out of tree init routine to do this, and there would be the ideal place to put a call to pci_set_flag(PCI_SCAN_ALL_PCIE_DEVS). This patch fixes the last major hurdle to getting the X1000 fully supported in the linux kernel, so thanks very much for that. Regards Darren
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 14e0ea1ff38b..9e57d4ef0c1f 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2217,20 +2217,28 @@ static int only_one_child(struct pci_bus *bus) { struct pci_dev *parent = bus->self; - if (!parent || !pci_is_pcie(parent)) + if (!parent) + return 0; + + /* + * Systems with unusual topologies set PCI_SCAN_ALL_PCIE_DEVS so + * we scan for all possible devices, not just Device 0. + */ + if (pci_has_flag(PCI_SCAN_ALL_PCIE_DEVS)) return 0; - if (pci_pcie_type(parent) == PCI_EXP_TYPE_ROOT_PORT) - return 1; /* - * PCIe downstream ports are bridges that normally lead to only a - * device 0, but if PCI_SCAN_ALL_PCIE_DEVS is set, scan all - * possible devices, not just device 0. See PCIe spec r3.0, - * sec 7.3.1. + * A PCIe Downstream Port normally leads to a Link with only Device + * 0 on it (PCIe spec r3.1, sec 7.3.1). As an optimization, scan + * only for Device 0 in that situation. + * + * Checking has_secondary_link is a hack to identify Downstream + * Ports because sometimes Switches are configured such that the + * PCIe Port Type labels are backwards. */ - if (parent->has_secondary_link && - !pci_has_flag(PCI_SCAN_ALL_PCIE_DEVS)) + if (pci_is_pcie(parent) && parent->has_secondary_link) return 1; + return 0; }