OpenCloudOS-Kernel/drivers/pci/pcie
Bjorn Helgaas 030305d69f PCI/ASPM: Handle PCI-to-PCIe bridges as roots of PCIe hierarchies
In a struct pcie_link_state, link->root points to the pcie_link_state of
the root of the PCIe hierarchy.  For the topmost link, this points to
itself (link->root = link).  For others, we copy the pointer from the
parent (link->root = link->parent->root).

Previously we recognized that Root Ports originated PCIe hierarchies, but
we treated PCI/PCI-X to PCIe Bridges as being in the middle of the
hierarchy, and when we tried to copy the pointer from link->parent->root,
there was no parent, and we dereferenced a NULL pointer:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000090
  IP: [<ffffffff9e424350>] pcie_aspm_init_link_state+0x170/0x820

Recognize that PCI/PCI-X to PCIe Bridges originate PCIe hierarchies just
like Root Ports do, so link->root for these devices should also point to
itself.

Fixes: 51ebfc92b7 ("PCI: Enumerate switches below PCI-to-PCIe bridges")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=193411
Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1022181
Tested-by: lists@ssl-mail.com
Tested-by: Jayachandran C. <jnair@caviumnetworks.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: stable@vger.kernel.org	# v4.2+
2017-01-27 15:00:45 -06:00
..
aer pci-v4.10-changes 2016-12-15 12:46:48 -08:00
Kconfig PCI: Add Precision Time Measurement (PTM) support 2016-08-15 13:44:08 -05:00
Makefile PCI: Add Precision Time Measurement (PTM) support 2016-08-15 13:44:08 -05:00
aspm.c PCI/ASPM: Handle PCI-to-PCIe bridges as roots of PCIe hierarchies 2017-01-27 15:00:45 -06:00
pcie-dpc.c PCI: Make DPC explicitly non-modular 2016-08-24 16:52:24 -05:00
pme.c PCI/PME: Log PME IRQ when claiming Root Port 2016-12-12 10:05:23 -06:00
portdrv.h Merge branches 'pci/dpc', 'pci/resource' and 'pci/thunderbolt' into next 2016-05-03 11:49:21 -05:00
portdrv_acpi.c Merge branches 'pci/dpc', 'pci/resource' and 'pci/thunderbolt' into next 2016-05-03 11:49:21 -05:00
portdrv_bus.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
portdrv_core.c PCI: Remove service driver load/unload messages 2016-12-12 10:05:24 -06:00
portdrv_pci.c PCI: Consolidate conditions to allow runtime PM on PCIe ports 2016-11-17 18:46:22 -06:00
ptm.c PCI: Add PTM clock granularity information 2016-08-25 08:32:34 -05:00