device: Enable ASPM for TBT PCIe root ports

The virtual/generic device under TBT PCIe root ports has path type as
DEVICE_PATH_GENERIC. While scanning the pcie bus, the generic device
blocks its root ports configuration. This change adds device path type
check and enables ASPM for TBT root ports.

BUG=b:173207454
TEST=Built image and booted to kernel on Voxel board. Verified both of
the TBT Root ports 00:07.0 and 00:07.1 ASPM are enabled.

Signed-off-by: John Zhao <john.zhao@intel.com>
Change-Id: I82ffaeb5a8821d9034d8dae9d98d3b5953a9608b
This commit is contained in:
John Zhao
2020-11-17 15:08:53 -08:00
committed by Jeremy Soller
parent 79aa5fa87f
commit d13acd817d

View File

@@ -446,7 +446,7 @@ static void pciexp_tune_dev(struct device *dev)
unsigned int root_cap, cap;
cap = pci_find_capability(dev, PCI_CAP_ID_PCIE);
if (!cap)
if (!cap && (dev->path.type != DEVICE_PATH_GENERIC))
return;
root_cap = pci_find_capability(root, PCI_CAP_ID_PCIE);
@@ -480,7 +480,8 @@ void pciexp_scan_bus(struct bus *bus, unsigned int min_devfn,
pci_scan_bus(bus, min_devfn, max_devfn);
for (child = bus->children; child; child = child->sibling) {
if (child->path.type != DEVICE_PATH_PCI)
if ((child->path.type != DEVICE_PATH_PCI) &&
(child->path.type != DEVICE_PATH_GENERIC))
continue;
if ((child->path.pci.devfn < min_devfn) ||
(child->path.pci.devfn > max_devfn)) {