hvc_console: Better kernel console support
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 23 Jul 2012 21:33:13 +0000 (21:33 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 5 Sep 2012 05:19:34 +0000 (15:19 +1000)
commit92057a493af4bb56928a762ad0423200b835d995
treef1c7377ff78695e493372eeec5e7071fc84b63e3
parentbaa436b3676ac0eea48dfbeaf7babf53a2305bba
hvc_console: Better kernel console support

hvc_console has two methods to instanciate the consoles.

hvc_instanciate is meant to be called at early boot, while hvc_alloc is
called for more dynamically probed objects.

Currently, it only deals with adding kernel consoles in the former case,
which means for example that if a console only uses dynamic probing, it
will never be usable as a kernel console even when specifying
console=hvc0 explicitly, which could be considered annoying...

More specifically, on pseries, we only do the early instanciate for the
console currently used by the firmware, so if you have your firmware
configured to go to a video card, for example, you cannot get your
kernel console, oops messages, etc... on your serial port or hypervisor
console, which would be handy to deal with oopses.

This fixes it by checking if hvc_console.flags & CON_ENABLED is set when
registering a new dynamic console, and if not, redo the index check and
re-register the console if the index matches, allowing console=hvcN to
work.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
drivers/tty/hvc/hvc_console.c