coreboot/src
Bill XIE 385e43274e pciexp_device: Handle unsupported requests in pciexp_get_ext_cap_offset()
Looking into pciexp_get_ext_cap_offset() it seems a little hackish
and prone to endless loops. Either it should limit the loop or bail
out when pci_read_config32() returns 0xffffffff, meaning "Unsupported
Requests".

This commit fixes an endless loop when the queried PCIe device is
downstream of a legacy PCI bus which doesn't support extended config
space, thus pci_read_config32() will return 0xffffffff, for example,
the combination below with CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS
enabled.

TEST=Build and boot to OS in ASUS P8C WS with the following
peripherals and CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS enabled:

00:1c.4 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series
	Chipset Family PCI Express Root Port 5 [8086:1e18] (rev c4)

00:1c.4/00.0 SATA controller [0106]: Marvell Technology Group Ltd.
	88SE9170 PCIe 2.0 x1 2-port SATA 6 Gb/s Controller [1b4b:9170]
	(rev 13)

00:1e.0 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge
	[8086:244e] (rev a4)

00:1e.0/00.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8111 PCI
	Express-to-PCI Bridge [10b5:8111] (rev 21)

00:1e.0/03.0 FireWire (IEEE 1394) [0c00]: VIA Technologies, Inc.
	VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller [1106:3044]
	(rev c0)

00:1e.0/00.0/00.0 Network controller [0280]: Qualcomm Atheros AR93xx
	Wireless Network Adapter [168c:0030] (rev 01)

with 00:1c.4/00.0 being successfully tuned with pciexp_tune_dev(), and
00: 1e.0/00.0/00.0 not tuned as expected.
Change-Id: Ibb92548c47288b40e851fcc0a8a37937e8bdbf3c
Signed-off-by: Bill XIE <persmule@hardenedlinux.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66439
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2022-08-07 19:49:35 +00:00
..
acpi treewide: Unify Google branding 2022-07-04 14:02:26 +00:00
arch arch/x86/acpi: Replace Store() with ASL 2.0 syntax 2022-07-30 00:11:58 +00:00
commonlib commonlib/timestamp_serialized: Add comment explaining "ignore for x86" 2022-08-07 19:28:09 +00:00
console console: Make CONSOLE_SPI_FLASH depend on BOOT_DEVICE_SPI_FLASH 2022-04-27 06:55:47 +00:00
cpu arch/x86: Fix MAX_CPUS check proper for late X2APIC config 2022-07-25 10:06:18 +00:00
device pciexp_device: Handle unsupported requests in pciexp_get_ext_cap_offset() 2022-08-07 19:49:35 +00:00
drivers payloads/tianocore: Remove the option for CorebootPayloadPkg 2022-08-07 19:48:17 +00:00
ec ec/system76/ec: Provide charging thresholds by default 2022-07-16 22:48:06 +00:00
include pci_device: Add a function to find PCI capability ID recursively 2022-08-07 19:41:38 +00:00
lib lib/program_loaders.c: Mark run_ramstage with __noreturn 2022-07-14 23:10:17 +00:00
mainboard mb/google/rex: Remove depedency on board id for early GPIO config 2022-08-07 19:43:20 +00:00
northbridge nb/amd: Fix some white spaces issues 2022-07-17 21:57:31 +00:00
security security/vboot: Simplify image signing 2022-07-30 18:29:25 +00:00
soc soc/intel/alderlake: Fix RPL-P 282 15W GT ICC MAX 2022-08-07 19:46:52 +00:00
southbridge sb/intel/bd82x6x/acpi: Replace LEqual(a,b) with ASL 2.0 syntax 2022-07-29 10:16:25 +00:00
superio superio/nuvoton/nct6687d: Add ramstage driver and ACPI 2022-07-08 15:40:31 +00:00
vendorcode vc/intel/fsp: Update ADL N FSP headers from v3222.03 to v3267.01 2022-08-07 19:39:43 +00:00
Kconfig src/Kconfig: src/soc/*/Kconfig files are gone, remove the include 2022-06-24 04:00:15 +00:00