On 24/03/20 10:54 am, Chris Packham wrote:
Hi Christophe,
On Wed, 2020-02-05 at 12:03 +0000, Christophe Leroy wrote:
[ 0.000000] ioremap() called early fromI was just about to dig into this error message and found you patch. I
find_legacy_serial_ports+0x3cc/0x474. Use early_ioremap() instead
applied it to a v5.5 base.
find_legacy_serial_ports() is called early from setup_arch(), beforeOn my system (Freescale T2080 SOC) this seems to cause a crash/hang in
paging_init(). vmalloc is not available yet, ioremap shouldn't be
used that early.
Use early_ioremap() and switch to a regular ioremap() later.
Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxx>
early boot. Unfortunately because this is affecting the boot console I
don't get any earlyprintk output.
I've been doing a bit more digging into why Christophe's patch didn't
work for me. I noticed the powerpc specific early_ioremap_range()
returns addresses around ioremap_bot. Yet the generic early_ioremap()
uses addresses around FIXADDR_TOP. If I try the following hack I can
make Christophe's patch work
diff --git a/arch/powerpc/include/asm/fixmap.h
b/arch/powerpc/include/asm/fixmap.h
index 2ef155a3c821..7bc2f3f73c8b 100644
--- a/arch/powerpc/include/asm/fixmap.h
+++ b/arch/powerpc/include/asm/fixmap.h
@@ -27,7 +27,7 @@
#include <asm/kasan.h>
#define FIXADDR_TOP (KASAN_SHADOW_START - PAGE_SIZE)
#else
-#define FIXADDR_TOP ((unsigned long)(-PAGE_SIZE))
+#define FIXADDR_TOP (IOREMAP_END - PAGE_SIZE)
#endif
/*
I'll admit to being out of my depth. It seems that the generic
early_ioremap() is not quite correctly plumbed in for powerpc.