aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGisle Nes <gisle@gisle.net>2026-04-07 16:48:15 +0000
committerShengYi Hung <aokblast@FreeBSD.org>2026-05-09 09:09:05 +0000
commit555ffd9022de0c497881bafc413e3e1d05af10d4 (patch)
tree6e8009d1b4d941d9c4156bdefe64adda941b5fe7
parent44338ccd12685621c4b1c57e692a4f27f5a655d3 (diff)
pci: use uint32_t for eecp
eecp holds the extended capability offset. If that offset is larger than 0xff, storing it in uint8_t truncates it, which can make the early EHCI/XHCI capability walk read the wrong location and loop during boot. Seen on AMD device 1022:151e, where HCCPARAMS1 = 0x0118ffc5 and the first xHCI extended capability offset is 0x460. Widen eecp to uint32_t in xhci_early_takeover(), matching xhci_pci_take_controller(). Signed-off-by: Gisle Nes <gisle@gisle.net> Reviewed by: zlei, aokblast MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/2127 Closes: https://github.com/freebsd/freebsd-src/pull/2127
-rw-r--r--sys/dev/pci/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 0dddd2dd263f..b5a3012accd6 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -3756,7 +3756,7 @@ xhci_early_takeover(device_t self)
struct resource *res;
uint32_t cparams;
uint32_t eec;
- uint8_t eecp;
+ uint32_t eecp;
uint8_t bios_sem;
uint8_t offs;
int rid;