Patch "serial: 8250: Fix restoring termios speed after suspend" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    serial: 8250: Fix restoring termios speed after suspend

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     serial-8250-fix-restoring-termios-speed-after-suspen.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit cd741992f7e252c15425d085293ed84f19ff223a
Author: Pali Rohár <pali@xxxxxxxxxx>
Date:   Sat Sep 24 12:43:24 2022 +0200

    serial: 8250: Fix restoring termios speed after suspend
    
    [ Upstream commit 379a33786d489ab81885ff0b3935cfeb36137fea ]
    
    Since commit edc6afc54968 ("tty: switch to ktermios and new framework")
    termios speed is no longer stored only in c_cflag member but also in new
    additional c_ispeed and c_ospeed members. If BOTHER flag is set in c_cflag
    then termios speed is stored only in these new members.
    
    Since commit 027b57170bf8 ("serial: core: Fix initializing and restoring
    termios speed") termios speed is available also in struct console.
    
    So properly restore also c_ispeed and c_ospeed members after suspend to fix
    restoring termios speed which is not represented by Bnnn constant.
    
    Fixes: 4516d50aabed ("serial: 8250: Use canary to restart console after suspend")
    Signed-off-by: Pali Rohár <pali@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220924104324.4035-1-pali@xxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index ee457f5d504f..ec7846223f3a 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -3318,8 +3318,13 @@ static void serial8250_console_restore(struct uart_8250_port *up)
 	unsigned int baud, quot, frac = 0;
 
 	termios.c_cflag = port->cons->cflag;
-	if (port->state->port.tty && termios.c_cflag == 0)
+	termios.c_ispeed = port->cons->ispeed;
+	termios.c_ospeed = port->cons->ospeed;
+	if (port->state->port.tty && termios.c_cflag == 0) {
 		termios.c_cflag = port->state->port.tty->termios.c_cflag;
+		termios.c_ispeed = port->state->port.tty->termios.c_ispeed;
+		termios.c_ospeed = port->state->port.tty->termios.c_ospeed;
+	}
 
 	baud = serial8250_get_baud_rate(port, &termios, NULL);
 	quot = serial8250_get_divisor(port, baud, &frac);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux