• C
    [S390] sclp_vt220: Fix vt220 initialization · 59eb1ca7
    Christian Borntraeger 提交于
    There are two problems in the vt220 intialization:
    
    o Currently the vt220 console looses early printk events until the
      the vt220 tty is registered.
    o console should work if tty_register fails
    
    sclp_vt220_con_init calls __sclp_vt220_init and register_console.
    It does not register the driver with the sclp core code via
    sclp_register. That results in an sclp_send_mask=0. Therefore,
    __sclp_vt220_emit will reject buffers with EIO. Unfortunately
    register_console will cause the printk buffer to be sent to the
    console and, therefore, every early message gets dropped. The
    sclp_send_mask is set later during boot, when sclp_vt220_tty_init
    calls sclp_register.
    
    The solution is to move the sclp_register call from sclp_vt220_tty_init
    to __sclp_vt220_init. This makes sure that the console is properly
    registered with the sclp subsystem before the first log buffer messages
    are passed to the vt220 console.
    
    We also adopt the cleanup on error to keep the console alive if
    tty_register fails.
    
    Thanks to Peter Oberparleiter and Heiko Carstens for review and ideas
    for improvement.
    Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
    59eb1ca7
sclp_vt220.c 21.2 KB