]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
LoongArch: Use per-root-bridge PCIH flag to skip mem resource fixup
authorHuacai Chen <chenhuacai@loongson.cn>
Mon, 4 May 2026 01:00:20 +0000 (09:00 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Mon, 4 May 2026 01:00:20 +0000 (09:00 +0800)
commit49f33840dcc907d21313d369e34872880846b61c
treec44ac7b225940bb977cf9cb9e37ce3ea2e236451
parent98b8aebb14fdc0133939fd8fe07d0d98333dc976
LoongArch: Use per-root-bridge PCIH flag to skip mem resource fixup

When firmware enables 64-bit PCI host bridge support, some root bridges
already provide valid 64-bit mem resource windows through ACPI.

In this case, the LoongArch-specific mem resource high-bits fixup in
acpi_prepare_root_resources() should not be applied unconditionally.
Otherwise, the kernel may override the native resource layout derived
from firmware, and later BAR assignment can fail to place device BARs
into the intended 64-bit address space correctly.

Add a per-root-bridge ACPI flag, PCIH, and evaluate it from the current
root bridge device scope. When PCIH is set, skip the mem resource high-
bits fixup path and let the kernel use the firmware-provided resource
description directly. When PCIH is absent or cleared, keep the existing
behavior and continue filling the high address bits from the host bridge
address.

This makes the behavior per-root-bridge configurable and avoids breaking
valid 64-bit BAR space allocation on bridges whose 64-bit windows have
already been fully described by firmware.

Cc: stable@vger.kernel.org
Suggested-by: Chao Li <lichao@loongson.cn>
Tested-by: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/pci/acpi.c