android_kernel_oneplus_msm8998/drivers/pci
Bjorn Helgaas 62e546b2d3 PCI/ASPM: Handle PCI-to-PCIe bridges as roots of PCIe hierarchies
commit 030305d69fc6963c16003f50d7e8d74b02d0a143 upstream.

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: 51ebfc92b72b ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 08:02:44 +01:00
..
host PCI: keystone: Fix MSI code that retrieves struct pcie_port pointer 2016-03-09 15:34:49 -08:00
hotplug powerpc/pci/rpadlpar: Fix device reference leaks 2017-01-12 11:22:50 +01:00
pcie PCI/ASPM: Handle PCI-to-PCIe bridges as roots of PCIe hierarchies 2017-02-09 08:02:44 +01:00
access.c
ats.c
bus.c
host-bridge.c
hotplug-pci.c
htirq.c
iov.c
irq.c
Kconfig
Makefile
msi.c genirq/msi: Make sure PCI MSIs are activated early 2016-09-07 08:32:38 +02:00
of.c
pci-acpi.c
pci-driver.c
pci-label.c
pci-stub.c
pci-sysfs.c PCI: Support PCIe devices with short cfg_size 2016-09-07 08:32:37 +02:00
pci.c PCI: Check for PME in targeted sleep state 2017-01-09 08:07:52 +01:00
pci.h
probe.c PCI: Enumerate switches below PCI-to-PCIe bridges 2017-01-26 08:23:48 +01:00
proc.c
quirks.c PCI: Mark Atheros AR9580 to avoid bus reset 2016-10-28 03:01:26 -04:00
remove.c
rom.c
search.c
setup-bus.c
setup-irq.c
setup-res.c
slot.c
syscall.c
vc.c
vpd.c
xen-pcifront.c xen/pcifront: Fix mysterious crashes when NUMA locality information was extracted. 2016-03-03 15:07:30 -08:00