linux-yocto/arch
Ilpo Järvinen fb08fec721 sparc/PCI: Correct 64-bit non-pref -> pref BAR resources
[ Upstream commit bdb32359eab94013e80cf7e3d40a3fd4972da93a ]

SPARC T5-2 dts describes some PCI BARs as 64-bit resources without the
pref(etchable) bit (0x83... vs 0xc3... in assigned-addresses) for address
ranges above the 4G threshold. Such resources cannot be placed into a
non-prefetchable PCI bridge window that is capable only of 32-bit
addressing. As such, it looks like the platform is improperly described by
the dts.

The kernel detects this problem (see the IORESOURCE_PREFETCH check in
pci_find_parent_resource()) and fails to assign these BAR resources to the
resource tree due to lack of a compatible bridge window.

Prior to 754babaaf3 ("sparc/PCI: Remove pcibios_enable_device() as they
do nothing extra") SPARC arch code did not test whether device resources
were successfully in the resource tree when enabling a device, effectively
hiding the problem. After removing the arch-specific enable code,
pci_enable_resources() refuses to enable the device when it finds not all
mem resources are assigned, and therefore mpt3sas can't be enabled:

  pci 0001:04:00.0: reg 0x14: [mem 0x801110000000-0x80111000ffff 64bit]
  pci 0001:04:00.0: reg 0x1c: [mem 0x801110040000-0x80111007ffff 64bit]
  pci 0001:04:00.0: BAR 1 [mem 0x801110000000-0x80111000ffff 64bit]: can't claim; no compatible bridge window
  pci 0001:04:00.0: BAR 3 [mem 0x801110040000-0x80111007ffff 64bit]: can't claim; no compatible bridge window
  mpt3sas 0001:04:00.0: BAR 1 [mem size 0x00010000 64bit]: not assigned; can't enable device

For clarity, this filtered log only shows failures for one mpt3sas device
but other devices fail similarly. In the reported case, the end result with
all the failures is an unbootable system.

Things appeared to "work" before 754babaaf3 ("sparc/PCI: Remove
pcibios_enable_device() as they do nothing extra") because the resource
tree is agnostic to whether PCI BAR resources are properly in the tree or
not. So as long as there was a parent resource (e.g. a root bus resource)
that contains the address range, the resource tree code just places
resource request underneath it without any consideration to the
intermediate BAR resource. While it worked, it's incorrect setup still.

Add an OF fixup to set the IORESOURCE_PREFETCH flag for a 64-bit PCI
resource that has the end address above 4G requiring placement into the
prefetchable window. Also log the issue.

Fixes: 754babaaf3 ("sparc/PCI: Remove pcibios_enable_device() as they do nothing extra")
Reported-by: Nathaniel Roach <nroach44@gmail.com>
Closes: https://github.com/sparclinux/issues/issues/22
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Nathaniel Roach <nroach44@gmail.com>
Link: https://patch.msgid.link/20251124170411.3709-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-01-17 16:35:29 +01:00
..
alpha alpha: don't reference obsolete termio struct for TC* constants 2026-01-17 16:35:16 +01:00
arc Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
arm ARM: dts: imx6q-ba16: fix RTC interrupt level 2026-01-17 16:35:20 +01:00
arm64 arm64: dts: mba8mx: Fix Ethernet PHY IRQ support 2026-01-17 16:35:21 +01:00
csky csky: fix csky_cmpxchg_fixup not working 2026-01-17 16:35:16 +01:00
hexagon Remove long-stale ext3 defconfig option 2025-10-15 07:57:28 -07:00
loongarch LoongArch: BPF: Enhance the bpf_arch_text_poke() function 2026-01-08 10:17:21 +01:00
m68k Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
microblaze Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
mips MIPS: ftrace: Fix memory corruption when kernel is located beyond 32 bits 2026-01-02 12:57:03 +01:00
nios2 Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
openrisc Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
parisc parisc: entry: set W bit for !compat tasks in syscall_restore_rfi() 2026-01-08 10:17:01 +01:00
powerpc powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION 2026-01-08 10:17:02 +01:00
riscv riscv: pgtable: Cleanup useless VA_USER_XXX definitions 2026-01-17 16:35:25 +01:00
s390 KVM: s390: Fix gmap_helper_zap_one_page() again 2026-01-08 10:16:41 +01:00
sh Remove long-stale ext3 defconfig option 2025-10-15 07:57:28 -07:00
sparc sparc/PCI: Correct 64-bit non-pref -> pref BAR resources 2026-01-17 16:35:29 +01:00
um um: init cpu_tasks[] earlier 2026-01-02 12:56:59 +01:00
x86 x86/microcode/AMD: Fix Entrysign revision check for Zen5/Strix Halo 2026-01-08 10:17:11 +01:00
xtensa Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
.gitignore
Kconfig compiler_types: Introduce __nocfi_generic 2025-10-29 20:04:55 -07:00