Skip to content

Commit 912ab37

Browse files
Claire Changgregkh
authored andcommitted
serial: 8250_mtk: Fix uart_get_baud_rate warning
Mediatek 8250 port supports speed higher than uartclk / 16. If the baud rates in both the new and the old termios setting are higher than uartclk / 16, the WARN_ON in uart_get_baud_rate() will be triggered. Passing NULL as the old termios so uart_get_baud_rate() will use uartclk / 16 - 1 as the new baud rate which will be replaced by the original baud rate later by tty_termios_encode_baud_rate() in mtk8250_set_termios(). Fixes: 551e553 ("serial: 8250_mtk: Fix high-speed baud rates clamping") Signed-off-by: Claire Chang <tientzu@chromium.org> Link: https://lore.kernel.org/r/20201102120749.374458-1-tientzu@chromium.org Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3cea11c commit 912ab37

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/tty/serial/8250/8250_mtk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios,
317317
*/
318318
baud = tty_termios_baud_rate(termios);
319319

320-
serial8250_do_set_termios(port, termios, old);
320+
serial8250_do_set_termios(port, termios, NULL);
321321

322322
tty_termios_encode_baud_rate(termios, baud, baud);
323323

0 commit comments

Comments
 (0)