From bba97354b05cc8770d6d913bfe5777b46450bbb8 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Fri, 5 Aug 2022 13:09:25 +0200 Subject: [PATCH] pciexp_device: Properly search for Intel's 0xcafe capability We have this quirk in our tree since the introduction of L1-substate support[1]. The way we searched for this capability was rather crude: We simply assumed that it would show up in the first data word of another capability. As it turned out that it is actually a proper vendor-specific capa- bility that we are looking for, we can drop some of the mystic code. This was confirmed to work on the device that was originally used during development, Google/Samus. [1] commit 31c6e632cf (PCIe: Add L1 Sub-State support.) Change-Id: I886fb96e9a92387bc0e2a7feb746f7842cee5476 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/66455 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/device/pciexp_device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/device/pciexp_device.c b/src/device/pciexp_device.c index bc4012503a..3bb5cb82df 100644 --- a/src/device/pciexp_device.c +++ b/src/device/pciexp_device.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -387,7 +388,10 @@ static void pciexp_config_L1_sub_state(struct device *root, struct device *dev) end_cap = pciexp_find_extended_cap(dev, PCIE_EXT_CAP_L1SS_ID, 0); if (!end_cap) { - end_cap = pciexp_find_extended_cap(dev, 0xcafe, 0); + if (dev->vendor != PCI_VID_INTEL) + return; + + end_cap = pciexp_find_ext_vendor_cap(dev, 0xcafe, 0); if (!end_cap) return; }