mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
pcib: Only apply ARI translation to a bridge's own secondary bus
ARI changes RID interpretation only for the device on a downstream
port's secondary bus. pcib_xlate_ari() applied that translation to
every config access through an ARI-enabled bridge, including cycles
forwarded to a subordinate bus.
A non-zero slot on a subordinate bus then panics an INVARIANTS kernel
and is misrouted otherwise. Translate only when the access targets
this bridge's secondary bus.
Reviewed by: kib, jhb
Fixes: 55d3ea1731 ("Add support for PCIe ARI")
Sponsored by: AMD
Differential Revision: https://reviews.freebsd.org/D60033
This commit is contained in:
1 parent
0be29268ae
commit
10409ee40b
1 file changed
+2
-1
@@ -2346,7 +2346,8 @@ pcib_xlate_ari(device_t pcib, int bus, int *slot, int *func)
|
||||
sc = device_get_softc(pcib);
|
||||
ari_func = *func;
|
||||
|
||||
if (sc->flags & PCIB_ENABLE_ARI) {
|
||||
/* ARI applies only to this port's secondary bus. */
|
||||
if ((sc->flags & PCIB_ENABLE_ARI) && bus == sc->bus.sec) {
|
||||
KASSERT(*slot == 0,
|
||||
("Non-zero slot number with ARI enabled!"));
|
||||
*slot = PCIE_ARI_SLOT(ari_func);
|
||||
|
||||
Reference in new issue
Block a user