coreboot-kgpe-d16/src/device
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
..
dram device: Remove unused <cbmem.h> 2022-04-22 21:40:07 +00:00
oprom treewide: Remove "ERROR: "/"WARN: " prefixes from log messages 2022-02-07 23:29:09 +00:00
azalia_device.c treewide: Get rid of CONFIG_AZALIA_MAX_CODECS 2022-02-22 17:40:30 +00:00
cardbus_device.c
cpu_device.c
device.c arch/x86/ebda.c: Move setting up ebda to a BS hook 2022-05-17 11:24:12 +00:00
device_const.c device: Drop unused function dev_find_matching_device_on_bus 2021-09-24 21:20:07 +00:00
device_util.c device: Fix 64Bit Device Resource Info Print 2022-08-03 21:17:00 +00:00
gpio.c
i2c.c
i2c_bus.c dev/i2c_bus: Fix count argument in i2c_dev_detect() 2022-08-03 20:55:14 +00:00
Kconfig payloads/external: Add support for coreDOOM payload 2022-05-28 15:01:47 +00:00
Makefile.inc
mmio.c
pci_class.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
pci_device.c pci_device: Add a function to find PCI capability ID recursively 2022-08-07 19:41:38 +00:00
pci_early.c src/acpi to src/lib: Fix spelling errors 2021-10-05 18:06:39 +00:00
pci_ops.c Rename ECAM-specific MMCONF Kconfigs 2021-11-10 17:24:16 +00:00
pci_rom.c src: Make PCI ID define names shorter 2022-03-07 08:32:09 +00:00
pciexp_device.c pciexp_device: Handle unsupported requests in pciexp_get_ext_cap_offset() 2022-08-07 19:49:35 +00:00
pcix_device.c
pnp_device.c treewide: Remove "ERROR: "/"WARN: " prefixes from log messages 2022-02-07 23:29:09 +00:00
resource_allocator_common.c
resource_allocator_v3.c
resource_allocator_v4.c allocator_v4: Make it explicit that we start with the highest alignment 2022-06-27 14:00:23 +00:00
root_device.c device: Export enable_static_device() function 2020-10-21 15:35:24 +00:00
smbus_ops.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
software_i2c.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
xhci.c