Skip to content

Commit

Permalink
[POWERPC] Document when printk is useable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed May 9, 2008
1 parent 1b70c5a commit 24d9649
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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);

/*
Expand Down

0 comments on commit 24d9649

Please sign in to comment.