Revert "serial: core: Fix initializing and restoring termios speed"

This reverts commit e9adf72bdb which is
commit 027b57170bf8bb6999a28e4a5f3d78bf1db0f90c upstream.

It breaks the kernel abi and is not something that is necessary in
Android systems, so it is safe to revert.

Bug: 161946584
Fixes: e9adf72bdb ("serial: core: Fix initializing and restoring termios speed")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I158a28eb7a1ac7892c836abcdbc178129de69391
This commit is contained in:
Greg Kroah-Hartman 2021-11-19 12:04:53 +01:00
parent 91a7552bea
commit 9084a8ecc9
2 changed files with 2 additions and 16 deletions

View File

@ -220,11 +220,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
if (retval == 0) { if (retval == 0) {
if (uart_console(uport) && uport->cons->cflag) { if (uart_console(uport) && uport->cons->cflag) {
tty->termios.c_cflag = uport->cons->cflag; tty->termios.c_cflag = uport->cons->cflag;
tty->termios.c_ispeed = uport->cons->ispeed;
tty->termios.c_ospeed = uport->cons->ospeed;
uport->cons->cflag = 0; uport->cons->cflag = 0;
uport->cons->ispeed = 0;
uport->cons->ospeed = 0;
} }
/* /*
* Initialise the hardware port settings. * Initialise the hardware port settings.
@ -292,11 +288,8 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
/* /*
* Turn off DTR and RTS early. * Turn off DTR and RTS early.
*/ */
if (uport && uart_console(uport) && tty) { if (uport && uart_console(uport) && tty)
uport->cons->cflag = tty->termios.c_cflag; uport->cons->cflag = tty->termios.c_cflag;
uport->cons->ispeed = tty->termios.c_ispeed;
uport->cons->ospeed = tty->termios.c_ospeed;
}
if (!tty || C_HUPCL(tty)) if (!tty || C_HUPCL(tty))
uart_port_dtr_rts(uport, 0); uart_port_dtr_rts(uport, 0);
@ -2117,11 +2110,8 @@ uart_set_options(struct uart_port *port, struct console *co,
* Allow the setting of the UART parameters with a NULL console * Allow the setting of the UART parameters with a NULL console
* too: * too:
*/ */
if (co) { if (co)
co->cflag = termios.c_cflag; co->cflag = termios.c_cflag;
co->ispeed = termios.c_ispeed;
co->ospeed = termios.c_ospeed;
}
return 0; return 0;
} }
@ -2255,8 +2245,6 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
*/ */
memset(&termios, 0, sizeof(struct ktermios)); memset(&termios, 0, sizeof(struct ktermios));
termios.c_cflag = uport->cons->cflag; termios.c_cflag = uport->cons->cflag;
termios.c_ispeed = uport->cons->ispeed;
termios.c_ospeed = uport->cons->ospeed;
/* /*
* If that's unset, use the tty termios setting. * If that's unset, use the tty termios setting.

View File

@ -153,8 +153,6 @@ struct console {
short flags; short flags;
short index; short index;
int cflag; int cflag;
uint ispeed;
uint ospeed;
void *data; void *data;
struct console *next; struct console *next;
}; };