• Benjamin Herrenschmidt's avatar
    hvc_console: Better kernel console support · 92057a49
    Benjamin Herrenschmidt authored
    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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    92057a49
hvc_console.c 23.5 KB