Skip to content

Commit e2f5efd

Browse files
aikmpe
authored andcommitted
powerpc: Fix early setup to make early_ioremap() work
The immediate problem is that after commit 0bd3f9e ("powerpc/legacy_serial: Use early_ioremap()") the kernel silently reboots on some systems. The reason is that early_ioremap() returns broken addresses as it uses slot_virt[] array which initialized with offsets from FIXADDR_TOP == IOREMAP_END+FIXADDR_SIZE == KERN_IO_END - FIXADDR_SIZ + FIXADDR_SIZE == __kernel_io_end which is 0 when early_ioremap_setup() is called. __kernel_io_end is initialized little bit later in early_init_mmu(). This fixes the initialization by swapping early_ioremap_setup() and early_init_mmu(). Fixes: 265c349 ("powerpc: Add support for GENERIC_EARLY_IOREMAP") Signed-off-by: Alexey Kardashevskiy <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> [mpe: Drop unrelated cleanup & cleanup change log] Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d07f6ca commit e2f5efd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/kernel/setup_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,11 @@ void __init early_setup(unsigned long dt_ptr)
369369
apply_feature_fixups();
370370
setup_feature_keys();
371371

372-
early_ioremap_setup();
373-
374372
/* Initialize the hash table or TLB handling */
375373
early_init_mmu();
376374

375+
early_ioremap_setup();
376+
377377
/*
378378
* After firmware and early platform setup code has set things up,
379379
* we note the SPR values for configurable control/performance

0 commit comments

Comments
 (0)