]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
serial: stm32: fix FIFO flush in startup and set_termios
authorErwan Le Ray <erwan.leray@foss.st.com>
Thu, 4 Mar 2021 16:23:05 +0000 (17:23 +0100)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:19 +0000 (17:46 -0600)
commit3d7836e51ddd54114a01623eb79b81e9c5f296a3
treea30ee860edc31a69aebf09aa5dc0d4e75cbfb7c2
parentc0911033cd37d3ebef65eb21b1c1b6a5538b5bdb
serial: stm32: fix FIFO flush in startup and set_termios

BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 315e2d8a125ad77a1bc28f621162713f3e7aef48 ]

Fifo flush set USART_RQR register by calling stm32_usart_set_bits
routine (Read/Modify/Write). USART_RQR register is a write only
register. So, read before write isn't correct / relevant to flush
the FIFOs.
Replace stm32_usart_set_bits call by writel_relaxed.

Fixes: 84872dc448fe ("serial: stm32: add RX and TX FIFO flush")
Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
Link: https://lore.kernel.org/r/20210304162308.8984-11-erwan.leray@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/tty/serial/stm32-usart.c