]> git.ipfire.org Git - thirdparty/linux.git/commit
MIPS: Loongson2ef: Use pcibios_align_resource() to block io range
authorRong Zhang <rongrong@oss.cipunited.com>
Sat, 31 Jan 2026 21:32:59 +0000 (05:32 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Thu, 5 Feb 2026 09:00:37 +0000 (10:00 +0100)
commit32ec465103527ede09b640cd0ab0636dc58827fb
treea01b0573ad8086e5efb72fbcc5b353c1bc44ceda
parent6a00c043af07492502ba7a2263ddc4cdb01b66a7
MIPS: Loongson2ef: Use pcibios_align_resource() to block io range

Loongson2ef reserves io range below 0x4000 (LOONGSON_PCI_IO_START) while
ISA-mode only IDE controller on the south bridge still has a hard
dependency on ISA IO ports.

The reservation was done by lifting loongson_pci_io_resource.start onto
0x4000. Prior to commit ae81aad5c2e1 ("MIPS: PCI: Use
pci_enable_resources()"), the arch specific pcibios_enable_resources()
did not check if the resources were claimed, which diverges from what
PCI core checks, effectively hiding the fact that IDE IO resources were
not properly within the resource tree. After starting to use
pcibios_enable_resources() from PCI core, enabling IDE controller fails:

  pata_cs5536 0000:00:0e.2: BAR 0 [io  0x01f0-0x01f7]: not claimed; can't enable device
  pata_cs5536 0000:00:0e.2: probe with driver pata_cs5536 failed with error -22

MIPS PCI code already has support for enforcing lower bounds using
PCIBIOS_MIN_IO in pcibios_align_resource() without altering the IO
window start address itself. Make Loongson2ef PCI code use
PCIBIOS_MIN_IO too.

Fixes: ae81aad5c2e1 ("MIPS: PCI: Use pci_enable_resources()")
Cc: stable@vger.kernel.org
Tested-by: Beiyan Yun <root@infi.wang>
Tested-by: Yao Zi <me@ziyao.cc>
Signed-off-by: Rong Zhang <rongrong@oss.cipunited.com>
Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/loongson2ef/common/pci.c