linux/arch/mips/loongson2ef/common
Rong Zhang 32ec465103 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 ae81aad5c2 ("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: ae81aad5c2 ("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>
2026-02-05 10:00:37 +01:00
..
cs5536 MIPS: loongson2ef: Add missing break in cs5536_isa 2023-04-12 15:12:24 +02:00
bonito-irq.c MIPS: Replace setup_irq() by request_irq() 2020-03-05 16:47:35 +01:00
env.c MIPS: Loongson{2ef, 32, 64} convert to generic fw cmdline 2019-11-11 10:44:56 -08:00
init.c MIPS: init: move externs to header file 2021-01-07 17:12:51 +01:00
irq.c
machtype.c MIPS: Loongson2ef: Replace deprecated strncpy() with strscpy() 2025-02-27 10:40:01 +01:00
Makefile MIPS: loongson2ef: don't build serial.o unconditionally 2021-08-05 10:58:21 +02:00
mem.c MIPS: loongson2ef: remove function __uncached_access() 2021-01-27 21:51:15 +01:00
pci.c MIPS: Loongson2ef: Use pcibios_align_resource() to block io range 2026-02-05 10:00:37 +01:00
platform.c MIPS: Fix typos 2024-01-08 10:39:12 +01:00
pm.c MIPS: Loongson2ef: drop pointless static qualifier in loongson_suspend_enter() 2020-01-09 09:57:07 -08:00
reset.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
rtc.c
serial.c
setup.c MIPS: Loongson2ef: Register PCI controller in early stage 2026-02-05 10:00:37 +01:00
time.c
uart_base.c MIPS: Loongson2ef: Convert to early_printk_8250 2019-11-11 10:45:00 -08:00