* [PATCH 2/2] [POWERPC] Document when printk is useable
@ 2008-05-07 0:00 Benjamin Herrenschmidt
0 siblings, 0 replies; only message in thread
From: Benjamin Herrenschmidt @ 2008-05-07 0:00 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
When debugging early boot problems, it's common to sprinkle printk's
all over the place. However, on powerpc 64 bits, this can lead to
memory corruption if done too early due to the PACA pointer and
lockdep core not being initialized.
This adds some comments to early_setup() that document when it is
safe to do so in order to save time to whoever has to debug that
stuff next.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/setup_64.c | 4 ++++
1 file changed, 4 insertions(+)
--- linux-work.orig/arch/powerpc/kernel/setup_64.c 2008-05-07 09:54:52.000000000 +1000
+++ linux-work/arch/powerpc/kernel/setup_64.c 2008-05-07 09:56:31.000000000 +1000
@@ -170,6 +170,8 @@ void __init setup_paca(int cpu)
void __init early_setup(unsigned long dt_ptr)
{
+ /* -------- printk is _NOT_ safe to use here ! ------- */
+
/* Fill in any unititialised pacas */
initialise_pacas();
@@ -185,6 +187,8 @@ void __init early_setup(unsigned long dt
/* Initialize lockdep early or else spinlocks will blow */
lockdep_init();
+ /* -------- printk is now safe to use ------- */
+
DBG(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr);
/*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-05-07 0:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-07 0:00 [PATCH 2/2] [POWERPC] Document when printk is useable Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).