Thread (8 messages) 8 messages, 3 authors, 2025-10-23

Re: BAR resizing broken in 6.18 (PPC only?)

From: Manivannan Sadhasivam <mani@kernel.org>
Date: 2025-10-16 06:47:23
Also in: linux-pci

+ Ilpo

On Thu, Oct 16, 2025 at 12:08:46PM +0900, Simon Richter wrote:
Hi,

since switching to 6.18rc1, I get

xe 0030:03:00.0: enabling device (0140 -> 0142)
xe 0030:03:00.0: [drm] unbounded parent pci bridge, device won't support any
PM support.
xe 0030:03:00.0: [drm] Attempting to resize bar from 256MiB -> 16384MiB
xe 0030:03:00.0: BAR 0 [mem 0x620c000000000-0x620c000ffffff 64bit]:
releasing
xe 0030:03:00.0: BAR 2 [mem 0x6200000000000-0x620000fffffff 64bit pref]:
releasing
pci 0030:02:01.0: bridge window [mem 0x6200000000000-0x620001fffffff 64bit
pref]: releasing
pci 0030:01:00.0: bridge window [mem 0x6200000000000-0x6203fbff0ffff 64bit
pref]: releasing
pci 0030:00:00.0: bridge window [mem 0x6200000000000-0x6203fbff0ffff 64bit
pref]: was not released (still contains assigned resources)
pci 0030:02:01.0: disabling bridge window [io  0x0000-0xffffffffffffffff
disabled] to [bus 03] (unused)
pci 0030:02:02.0: disabling bridge window [io  0x0000-0xffffffffffffffff
disabled] to [bus 04] (unused)
pci 0030:02:02.0: disabling bridge window [mem 0x00000000-0xffffffffffffffff
64bit pref disabled] to [bus 04] (unused)
pci 0030:01:00.0: disabling bridge window [io  0x0000-0xffffffffffffffff
disabled] to [bus 02-04] (unused)
pci 0030:00:00.0: Assigned bridge window [mem
0x6200000000000-0x6203fbff0ffff 64bit pref] to [bus 01-04] cannot fit
0x4000000000 required for 0030:01:00.0 bridging to [bus 02-04]
pci 0030:01:00.0: bridge window [mem size 0x3fc0000000 64bit pref] to [bus
02-04] requires relaxed alignment rules
pci 0030:00:00.0: disabling bridge window [io  0x0000-0xffffffffffffffff
disabled] to [bus 01-04] (unused)
pci 0030:01:00.0: bridge window [mem size 0x3fc0000000 64bit pref]: can't
assign; no space
pci 0030:01:00.0: bridge window [mem size 0x3fc0000000 64bit pref]: failed
to assign
pci 0030:01:00.0: bridge window [mem size 0x3fc0000000 64bit pref]: can't
assign; no space
pci 0030:01:00.0: bridge window [mem size 0x3fc0000000 64bit pref]: failed
to assign
pci 0030:02:01.0: bridge window [mem size 0x400000000 64bit pref]: can't
assign; no space
pci 0030:02:01.0: bridge window [mem size 0x400000000 64bit pref]: failed to
assign
pci 0030:02:01.0: bridge window [mem size 0x400000000 64bit pref]: can't
assign; no space
pci 0030:02:01.0: bridge window [mem size 0x400000000 64bit pref]: failed to
assign
xe 0030:03:00.0: BAR 2 [mem size 0x400000000 64bit pref]: can't assign; no
space
xe 0030:03:00.0: BAR 2 [mem size 0x400000000 64bit pref]: failed to assign
xe 0030:03:00.0: BAR 0 [mem 0x620c000000000-0x620c000ffffff 64bit]: assigned
xe 0030:03:00.0: BAR 0 [mem 0x620c000000000-0x620c000ffffff 64bit]:
releasing
xe 0030:03:00.0: BAR 2 [mem size 0x400000000 64bit pref]: can't assign; no
space
xe 0030:03:00.0: BAR 2 [mem size 0x400000000 64bit pref]: failed to assign
xe 0030:03:00.0: BAR 0 [mem 0x620c000000000-0x620c000ffffff 64bit]: assigned
pci 0030:00:00.0: PCI bridge to [bus 01-04]
pci 0030:00:00.0:   bridge window [mem 0x620c000000000-0x620c07fefffff]
pci 0030:00:00.0:   bridge window [mem 0x6200000000000-0x6203fbff0ffff 64bit
pref]
pci 0030:01:00.0: bridge window [mem 0x6200000000000-0x6203fbff0ffff 64bit
pref]: can't claim; address conflict with 0030:01:00.0 [mem
0x6200020000000-0x62000207fffff 64bit pref]
pci 0030:01:00.0: PCI bridge to [bus 02-04]
pci 0030:01:00.0:   bridge window [mem 0x620c000000000-0x620c07fefffff]
pci 0030:02:01.0: bridge window [mem 0x6200000000000-0x620001fffffff 64bit
pref]: can't claim; no compatible bridge window
pci 0030:02:01.0: PCI bridge to [bus 03]
pci 0030:02:01.0:   bridge window [mem 0x620c000000000-0x620c0013fffff]
xe 0030:03:00.0: [drm] Failed to resize BAR2 to 16384M (-ENOSPC). Consider
enabling 'Resizable BAR' support in your BIOS
xe 0030:03:00.0: BAR 2 [mem size 0x10000000 64bit pref]: can't assign; no
space
xe 0030:03:00.0: BAR 2 [mem size 0x10000000 64bit pref]: failed to assign
xe 0030:03:00.0: BAR 2 [mem size 0x10000000 64bit pref]: can't assign; no
space
xe 0030:03:00.0: BAR 2 [mem size 0x10000000 64bit pref]: failed to assign
xe 0030:03:00.0: [drm] Found battlemage (device ID e20b) discrete display
version 14.01 stepping B0
xe 0030:03:00.0: [drm] *ERROR* pci resource is not valid

There's also a bug report[1] on the freedesktop GitLab, but this may be a
more generic problem.

I'm unsure what other "assigned resources" would be below the root that are
not covered by the bridge window of equal size on the upstream port of the
GPU -- also it would be really cool if it reverted to the old state on
failure instead of creating an invalid configuration.

Also, why do we change the BAR assignment while mem decoding is active?
This could be due to the recently merged patch that changes the way we read
bridge resources. We saw a similar bug report with Qcom platforms as well [1].a43ac325c7cb

Could you please try reverting the below mentioned commit and see if that fixes
the issue?

a43ac325c7cb ("PCI: Set up bridge resources earlier")

- Mani

[1] https://lore.kernel.org/lkml/017ff8df-511c-4da8-b3cf-edf2cb7f1a67@packett.cool (local)

-- 
மணிவண்ணன் சதாசிவம்
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help