1
0
Fork 0
remarkable-linux/drivers/pci/pcie
Ard Biesheuvel db98acd6f8 PCI/ASPM: Deal with missing root ports in link state handling
commit ee8bdfb656 upstream.

Even though it is unconventional, some PCIe host implementations omit the
root ports entirely, and simply consist of a host bridge (which is not
modeled as a device in the PCI hierarchy) and a link.

When the downstream device is an endpoint, our current code does not seem
to mind this unusual configuration. However, when PCIe switches are
involved, the ASPM code assumes that any downstream switch port has a
parent, and blindly dereferences the bus->parent->self field of the pci_dev
struct to chain the downstream link state to the link state of the root
port. Given that the root port is missing, the link is not modeled at all,
and nor is the link state, and attempting to access it results in a NULL
pointer dereference and a crash.

Avoid this by allowing the link state chain to terminate at the downstream
port if no root port exists.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-08 22:41:25 -08:00
..
aer PCI/AER: Report non-fatal errors only to the affected endpoint 2017-12-25 14:26:27 +01:00
Kconfig PCI/ASPM: Add support for L1 substates 2017-02-14 17:43:51 -06:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
aspm.c PCI/ASPM: Deal with missing root ports in link state handling 2018-03-08 22:41:25 -08:00
pcie-dpc.c PCI/DPC: Add local struct device pointers 2017-08-24 11:30:02 -05:00
pme.c PCI/PME: Handle invalid data when reading Root Status 2017-12-20 10:10:24 +01:00
portdrv.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01: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 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
portdrv_pci.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ptm.c PCI: Add PTM clock granularity information 2016-08-25 08:32:34 -05:00