]> git.baikalelectronics.ru Git - kernel.git/commit
serial: 8250_mtk: Fix uart_get_baud_rate warning
authorClaire Chang <tientzu@chromium.org>
Mon, 2 Nov 2020 12:07:49 +0000 (20:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Nov 2020 16:23:03 +0000 (17:23 +0100)
commitfd86d34a6400b002d7648ec5f96ffc52d1177b66
tree348c9fa2a20a191693245e420b41706e242acb06
parenta5b4f6b821b1563b54d8e4615d1b6ea21b7dc9d9
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: 30362d1c6890 ("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>
drivers/tty/serial/8250/8250_mtk.c