New: [REGRESSION] PCI: bridge window sized as plain sum of children loses NVMe/NIC/GPU behind chipset bridge on X670E (6.12 OK, 7.3 broken)
A message that is not in the archive (sent off-list or not yet received): [email protected]/
[reporter in bcc]
Reporter believes this regression is caused by 3958bf16e2fe ("PCI:
Stop over-estimating bridge window size")
---------- Forwarded message ---------
From: <[email protected]>
Date: Sat, Nov 28, 2026 at 9:04 PM
Subject: [Bug 222345] New: [REGRESSION] PCI: bridge window sized as plain sum of children loses NVMe/NIC/GPU behind chipset bridge on X670E (6.12 OK, 7.3 broken)
To: <[email protected]>
https://bugzilla.kernel.org/show_bug.cgi?id=222345
Bug ID: 222345
Summary: [REGRESSION] PCI: bridge window sized as plain sum of
children loses NVMe/NIC/GPU behind chipset bridge on
X670E (6.12 OK, 7.3 broken)
Product: Drivers
Version: 2.5
Hardware: All
OS: Linux
Status: NEW
Severity: blocking
Priority: P3
Component: PCI
Assignee: [email protected]
Reporter: [email protected]
Regression: NoCreated attachment 311619
--> https://bugzilla.kernel.org/attachment.cgi?id=311619&action=edit
dmesg logs for the X670E PCI bridge window regression (broken, pci=realloc, acpi_enforce_resources=lax, v5-gap-fixed) plus the diagnostic patch and full report text; see README.txt inside the archive
Summary
-------
Since the bridge window sizing change in 3958bf16e2fe ("PCI: Stop over-estimating bridge window size"), the memory window of root port 0000:00:02.1 on this X670E system is sized to exactly the sum of its child windows (41 MiB) instead of being rounded up to the head alignment (56 MiB on 6.12). The second child branch (04:08.0, which carries GPU4, a network controller, the root NVMe, USB 3.2 and SATA) then no longer fits and all devices below it fail to get resources. On 6.12.117 the same topology works.
The 41 MiB window is exactly the sum of the two child windows, so the allocation succeeds only if the children can be packed back to back. At least one child is a composite (non power of two) window, so that packing is not always possible, and the window is not grown by any gap.
Environment
-----------
Mainboard: AMD X670E chipset, Ryzen 9 7900X GPUs: 4 x NVIDIA RTX 3090 Distro: Manjaro, kernel 7.3.4-3-MANJARO (vanilla 7.3.4) Working: 6.12.117, same machine, same BIOS settings
PCI topology (relevant part):
0000:00:02.1 root port
0000:03:00.0 bridge
0000:04:00.0 bridge -> GPU3
0000:04:08.0 bridge -> GPU4, NIC, NVMe (Samsung 980 PRO, root
filesystem), USB 3.2 xHCI, SATA AHCIObserved behaviour (7.3.4)
---------------------------
pci 0000:00:02.1: bridge window [mem 0xd8000000-0xdb4fffff]: can't claim;
address conflict with AMDIF031:00 [mem 0xd9200000-0xd9200fff]
pci 0000:00:02.1: bridge window [mem 0xf2000000-0xf48fffff]: assigned pci 0000:04:08.0: bridge window [mem size 0x01500000]: can't assign; no space pci 0000:0b:00.0: BAR 0 [mem size 0x00004000 64bit]: can't assign; no space nvme 0000:0b:00.0: error -ENODEV: probe failed
The window at 0xf2000000 is 0x02900000 (41 MiB). The child window of 04:08.0 needs 0x01500000 (21 MiB).
Expected behaviour (6.12.117, same machine)
-------------------------------------------
pci 0000:00:02.1: bridge window [mem 0xf2000000-0xf57fffff]: assigned
i.e. 0x03800000 (56 MiB). All four GPUs, the NVMe, the NIC, USB and SATA get resources and the system boots normally.
The "can't claim; address conflict with AMDIF031:00" line is also present on 6.12 and is non-fatal there (firmware SSDT declares a Memory32Fixed _CRS inside the firmware-assigned window). The regression is in the re-assignment step that follows, not in the conflict itself.
Suspected cause
---------------
drivers/pci/setup-bus.c, pbus_size_mem() in 7.3.4:
win_align = pci_min_window_alignment(bus, b_res->flags);
min_align = calculate_head_align(aligns, max_order);
min_align = max(min_align, win_align);
size0 = calculate_memsize(size, realloc_head ? 0 : add_size,
0, win_align);
...
resource_set_range(b_res, min_align, size0);The window *start* is aligned to min_align (head alignment), but the window *size* is only aligned to win_align, which is 1 MiB. Up to 3958bf16e2fe the size was passed min_align:
- size0 = calculate_memsize(size, min_size, 0, 0, old_size,min_align);
+ size0 = calculate_memsize(size, min_size, 0, 0, old_size,win_align);
so the room needed to place children that cannot be packed gaplessly is no longer reserved. Here that room is 41 MiB -> 56 MiB.
calculate_head_align() (introduced by bc75c8e50711, "PCI: Rewrite bridge window head alignment function") guarantees a gapless layout only when the children can be placed back to back in decreasing alignment order. At least one child window on bus 03 (04:08.0, 21 MiB) is a composite size, so back-to-back placement is not possible and the window needs an explicit gap. The window size is not grown by such a gap, so the second child is left without space.
Verification of the diagnosis
-----------------------------
Passing min_align instead of win_align to both calculate_memsize() calls in pbus_size_mem() (i.e. restoring the 6.12 argument) and rebuilding 7.3.4 makes the root port window 96 MiB; every device below it, and all four GPUs, get resources and the system boots. This is only a diagnostic, not a proposed upstream fix, because padding the window up to min_align can waste a lot of address space when min_align is large.
Already tried, no effect
------------------------
pci=realloc, pci=nocrs, pci=big_root_window, acpi_enforce_resources=lax, module_blacklist=gpio_amdpt, Above 4G decoding on/off, ReBAR on/off.
Related reports and current upstream state
------------------------------------------
I could not find an existing report for this exact setup. The closest ones are:
https://bugzilla.kernel.org/show_bug.cgi?id=221493
X870E, same AMDIF031 conflict at 00:02.1, 6.12 OK / 6.18 broken. Resolved as CODE_FIX by the 10-patch series whose central patch is 9036bd0efcb6 ("PCI: Align head space better"). Note that 7.3.4 already contains that fix, so this is a further case that the head-space relocation does not cover: the window itself is too small, and relocating the remainder inside it cannot help.
https://bugzilla.kernel.org/show_bug.cgi?id=221205
"pci=realloc fails on 6.18.16 and 6.19.6", traced to
3958bf16e2fe as well.https://lore.kernel.org/linux-pci/[email protected]/
[REGRESSION] amdgpu with Thunderbolt eGPU bracket fails since new bridge window alignment calculation code, bisected to 3958bf16e2fe (b855d99 in 6.18.y).
https://lore.kernel.org/linux-pci/[email protected]/
Test of "[PATCH v5 00/14] PCI: Resource placement algorithm fixes" on v7.4-rc1 with four R9700s and two RTX 3090s: unpatched, the switch window is sized as the plain sum of its child windows and GPUs lose BARs; with v5 everything is assigned.
Mainline as of v7.4-rc4 (drivers/pci/setup-bus.c is byte-identical to v7.3.4 here) still passes win_align, so the window is still sized as the plain sum. The fix appears to be patch 13/14 of the v5 series, "PCI: Fix composite resource sizing" (Fixes: 9036bd0efcb6), which adds a gap to the window size returned by pbus_size_mem() (__pbus_size_mem() after the refactoring done earlier in that series):
- return ALIGN(max(winsize, min_size), win_align);
+ return ALIGN(max(winsize + gap, min_size), win_align);
Series and patch (links):
[PATCH v5 00/14] PCI: Resource placement algorithm fixes Ilpo Järvinen, 2026-11-06
https://lore.kernel.org/linux-pci/[email protected]/
[PATCH v5 13/14] PCI: Fix composite resource sizing
https://lore.kernel.org/linux-pci/[email protected]/
(mirror, if the above is unreachable:
https://lore-kernel.gnuweeb.org/linux-pci/[email protected]/raw
)
Question
--------
Is the failure above the case that "PCI: Fix composite resource sizing" is meant to cover?
Test result
-----------
I backported the gap calculation of patch 13/14
(https://lore.kernel.org/linux-pci/[email protected]/)
to the pre-refactoring shape of pbus_size_mem() as found in v7.3.4 (the series itself does not apply there because __pbus_size_mem() only exists after patches 10-12 of the series). With that change alone on top of v7.3.4:
pci 0000:00:02.1: bridge window [mem 0x40000000-0x452fffff]: assigned
i.e. 0x05300000 (83 MiB) instead of 41 MiB, and everything below it is assigned:
pci 0000:04:08.0: bridge window [mem 0x41c00000-0x43ffffff]: assigned pci 0000:0b:00.0: BAR 0 [mem 0x41d00000-0x41d03fff 64bit]: assigned
nvme nvme1: pci function 0000:0b:00.0 (no -ENODEV)
All four RTX 3090s enumerate, all three NVMe SSDs probe, the system boots to a working desktop. The window is 83 MiB, i.e. smaller than the 96 MiB obtained by reverting to the pre-3958bf16e2fe argument, which confirms that the gap is sized to the actual packing loss rather than rounded up to min_align.
So the v5 approach fixes this case. I am happy to test the actual v5 series on this machine (4 x RTX 3090 behind a chipset bridge, root NVMe on the affected branch) and report back with a Tested-by if it holds.
If not, I can provide full dmesg with dyndbg="file drivers/pci/*.c +p" and /proc/iomem for both 6.12.117 and 7.3.4.
Thanks,
<Alex>
--
You are receiving this mail because:
You are watching the assignee of the bug.