]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] Document when printk is useable
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 7 May 2008 00:00:56 +0000 (10:00 +1000)
committerPaul Mackerras <paulus@samba.org>
Fri, 9 May 2008 10:22:58 +0000 (20:22 +1000)
When debugging early boot problems, it's common to sprinkle printk's
all over the place.  However, on 64-bit powerpc, 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 for whoever has to debug that
stuff next.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/setup_64.c

index 25e3fd8606ab589ebae8ee51143e39a517d32505..f2cd82eaf49db12a35e658d63c465f5665e5f7ba 100644 (file)
@@ -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_ptr)
        /* 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);
 
        /*