alistair23-linux/drivers/pci
Yijing Wang d0751b98df PCI: Add dev->has_secondary_link to track downstream PCIe links
A PCIe Port is an interface to a Link.  A Root Port is a PCI-PCI bridge in
a Root Complex and has a Link on its secondary (downstream) side.  For
other Ports, the Link may be on either the upstream (closer to the Root
Complex) or downstream side of the Port.

The usual topology has a Root Port connected to an Upstream Port.  We
previously assumed this was the only possible topology, and that a
Downstream Port's Link was always on its downstream side, like this:

                  +---------------------+
  +------+        |          Downstream |
  | Root |        | Upstream       Port +--Link--
  | Port +--Link--+ Port                |
  +------+        |          Downstream |
                  |                Port +--Link--
                  +---------------------+

But systems do exist (see URL below) where the Root Port is connected to a
Downstream Port.  In this case, a Downstream Port's Link may be on either
the upstream or downstream side:

                  +---------------------+
  +------+        |            Upstream |
  | Root |        | Downstream     Port +--Link--
  | Port +--Link--+ Port                |
  +------+        |          Downstream |
                  |                Port +--Link--
                  +---------------------+

We can't use the Port type to determine which side the Link is on, so add a
bit in struct pci_dev to keep track.

A Root Port's Link is always on the Port's secondary side.  A component
(Endpoint or Port) on the other end of the Link obviously has the Link on
its upstream side.  If that component is a Port, it is part of a Switch or
a Bridge.  A Bridge has a PCI or PCI-X bus on its secondary side, not a
Link.  The internal bus of a Switch connects the Port to another Port whose
Link is on the downstream side.

[bhelgaas: changelog, comment, cache "type", use if/else]
Link: http://lkml.kernel.org/r/54EB81B2.4050904@pobox.com
Link: https://bugzilla.kernel.org/show_bug.cgi?id=94361
Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2015-05-22 09:59:33 -05:00
..
host PCI changes for the v4.1 merge window: 2015-04-13 15:45:47 -07:00
hotplug powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
pcie PCI/ASPM: Remove redundant PCIe port type checking 2015-05-20 12:28:11 -05:00
access.c PCI: Add generic config accessors 2015-01-22 13:59:45 -06:00
ats.c
bus.c PCI: Use common resource list management code instead of private implementation 2015-02-05 15:09:25 +01:00
host-bridge.c Merge branch 'pci/misc' into next 2015-04-10 08:27:18 -05:00
hotplug-pci.c
htirq.c
iov.c PCI: Add pcibios_iov_resource_alignment() interface 2015-03-31 13:02:36 +11:00
irq.c
Kconfig x86, irq: Make MSI and HT_IRQ indepenent of X86_IO_APIC 2014-12-16 14:08:17 +01:00
Makefile PCI: Remove PCI ioapic driver 2014-12-16 14:08:14 +01:00
msi.c PCI: Fail MSI-X mappings if there's no space assigned to MSI-X BAR 2015-01-28 09:25:57 -06:00
of.c
pci-acpi.c PCI changes for the v4.1 merge window: 2015-04-13 15:45:47 -07:00
pci-driver.c ACPI and power management updates for v3.20-rc1 2015-02-10 15:09:41 -08:00
pci-label.c PCI: Make a shareable UUID for PCI firmware ACPI _DSM 2015-04-08 14:39:30 -05:00
pci-stub.c
pci-sysfs.c PCI: Don't read past the end of sysfs "driver_override" buffer 2015-02-24 17:35:37 -06:00
pci.c Merge branch 'pci/misc' into next 2015-04-10 08:27:18 -05:00
pci.h powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
probe.c PCI: Add dev->has_secondary_link to track downstream PCIe links 2015-05-22 09:59:33 -05:00
proc.c
quirks.c Merge branch 'pci/misc' into next 2015-04-10 08:27:18 -05:00
remove.c PCI: Export symbols required for loadable host driver modules 2015-04-08 14:17:10 -05:00
rom.c PCI: Fix infinite loop with ROM image of size 0 2015-01-23 17:42:59 -06:00
search.c
setup-bus.c powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
setup-irq.c PCI: Export symbols required for loadable host driver modules 2015-04-08 14:17:10 -05:00
setup-res.c PCI: Mark invalid BARs as unassigned 2015-03-12 18:52:12 -05:00
slot.c
syscall.c
vc.c
vpd.c
xen-pcifront.c xenbus_client: Extend interface to support multi-page ring 2015-04-15 10:56:47 +01:00