• John Ogness's avatar
    printk: nbcon: Show replay message on takeover · 5102981d
    John Ogness authored
    An emergency or panic context can takeover console ownership
    while the current owner was printing a printk message. The
    atomic printer will re-print the message that the previous
    owner was printing. However, this can look confusing to the
    user and may even seem as though a message was lost.
    
      [3430014.1
      [3430014.181123] usb 1-2: Product: USB Audio
    
    Add a new field @nbcon_prev_seq to struct console to track
    the sequence number to print that was assigned to the previous
    console owner. If this matches the sequence number to print
    that the current owner is assigned, then a takeover must have
    occurred. In this case, print an additional message to inform
    the user that the previous message is being printed again.
    
      [3430014.1
      ** replaying previous printk message **
      [3430014.181123] usb 1-2: Product: USB Audio
    Signed-off-by: default avatarJohn Ogness <john.ogness@linutronix.de>
    Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
    Link: https://lore.kernel.org/r/20240904120536.115780-12-john.ogness@linutronix.deSigned-off-by: default avatarPetr Mladek <pmladek@suse.com>
    5102981d
nbcon.c 54.5 KB