]> git.baikalelectronics.ru Git - kernel.git/commit
serial: 8250_bcm7271: UART errors after resuming from S2
authorAl Cooper <alcooperx@gmail.com>
Wed, 1 Dec 2021 20:14:02 +0000 (15:14 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Dec 2021 13:14:49 +0000 (14:14 +0100)
commit70d276b8a4d3ef845cf8ce40eff9423b62fe1e04
tree216255317e4d46dbf1746adfb3f8369724f278a6
parent5954827563c178eca4a4351129620e2b5e88a9f7
serial: 8250_bcm7271: UART errors after resuming from S2

There is a small window in time during resume where the hardware
flow control signal RTS can be asserted (which allows a sender to
resume sending data to the UART) but the baud rate has not yet
been restored. This will cause corrupted data and FRAMING, OVERRUN
and BREAK errors. This is happening because the MCTRL register is
shadowed in uart_port struct and is later used during resume to set
the MCTRL register during both serial8250_do_startup() and
uart_resume_port(). Unfortunately, serial8250_do_startup()
happens before the UART baud rate is restored. The fix is to clear
the shadowed mctrl value at the end of suspend and restore it at the
end of resume.

Fixes: 8ef7811984ef ("serial: 8250: Add new 8250-core based Broadcom STB driver")
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Al Cooper <alcooperx@gmail.com>
Link: https://lore.kernel.org/r/20211201201402.47446-1-alcooperx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_bcm7271.c