[PATCH] Make printk work for really early debugging
authorMichael Ellerman <michael@ellerman.id.au>
Sun, 25 Jun 2006 12:47:40 +0000 (05:47 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 25 Jun 2006 17:01:05 +0000 (10:01 -0700)
commit76a8ad293912cd2f01eca075d80cd0ddec30c627
tree1ff683dcd5b1351b403d3efe701d0dd9eddcd773
parent8ae6e163c1b637e1cb125613726ffbd31ca44fdf
[PATCH] Make printk work for really early debugging

Currently printk is no use for early debugging because it refuses to
actually print anything to the console unless
cpu_online(smp_processor_id()) is true.

The stated explanation is that console drivers may require per-cpu
resources, or otherwise barf, because the system is not yet setup
correctly.  Fair enough.

However some console drivers might be quite happy running early during
boot, in fact we have one, and so it'd be nice if printk understood that.

So I added a flag (which I would have called CON_BOOT, but that's taken)
called CON_ANYTIME, which indicates that a console is happy to be called
anytime, even if the cpu is not yet online.

Tested on a Power 5 machine, with both a CON_ANYTIME driver and a bogus
console driver that BUG()s if called while offline.  No problems AFAICT.
Built for i386 UP & SMP.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/console.h
kernel/printk.c