Skip to content

Commit 6a00c04

Browse files
Rongronggg9tsbogend
authored andcommitted
MIPS: Loongson2ef: Register PCI controller in early stage
We are about to set loongson_pci_io_resource.start to 0 and adopt PCIBIOS_MIN_IO. As the first step, PCI controller needs to be registered in early stage to make it the root of other resources (e.g., i8259) and prevent resource conflicts. Register it in plat_mem_setup() instead of arch_initcall(). Fixes: ae81aad ("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>
1 parent a6ab150 commit 6a00c04

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

arch/mips/include/asm/mach-loongson2ef/loongson.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,10 @@ extern unsigned long _loongson_addrwincfg_base;
324324

325325
#endif /* ! CONFIG_CPU_SUPPORTS_ADDRWINCFG */
326326

327+
#ifdef CONFIG_PCI
328+
void loongson2ef_pcibios_init(void);
329+
#else
330+
static inline void loongson2ef_pcibios_init(void) { }
331+
#endif
332+
327333
#endif /* __ASM_MACH_LOONGSON2EF_LOONGSON_H */

arch/mips/loongson2ef/common/pci.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,10 @@ static void __init setup_pcimap(void)
7373
#endif
7474
}
7575

76-
static int __init pcibios_init(void)
76+
void __init loongson2ef_pcibios_init(void)
7777
{
7878
setup_pcimap();
7979

8080
loongson_pci_controller.io_map_base = mips_io_port_base;
8181
register_pci_controller(&loongson_pci_controller);
82-
83-
84-
return 0;
8582
}
86-
87-
arch_initcall(pcibios_init);

arch/mips/loongson2ef/common/setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ EXPORT_SYMBOL(__wbflush);
2727

2828
void __init plat_mem_setup(void)
2929
{
30+
loongson2ef_pcibios_init();
3031
}

0 commit comments

Comments
 (0)