mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
tty: serial: msm_serial: avoid system lockup condition
[ Upstream commit ba3684f99f ]
The function msm_wait_for_xmitr can be taken with interrupts
disabled. In order to avoid a potential system lockup - demonstrated
under stress testing conditions on SoC QCS404/5 - make sure we wait
for a bounded amount of time.
Tested on SoC QCS404.
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a0b6eaedb3
commit
19331fd9b8
@@ -391,10 +391,14 @@ no_rx:
|
||||
|
||||
static inline void msm_wait_for_xmitr(struct uart_port *port)
|
||||
{
|
||||
unsigned int timeout = 500000;
|
||||
|
||||
while (!(msm_read(port, UART_SR) & UART_SR_TX_EMPTY)) {
|
||||
if (msm_read(port, UART_ISR) & UART_ISR_TX_READY)
|
||||
break;
|
||||
udelay(1);
|
||||
if (!timeout--)
|
||||
break;
|
||||
}
|
||||
msm_write(port, UART_CR_CMD_RESET_TX_READY, UART_CR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user