Commit 663abb1a authored by Ryan Case's avatar Ryan Case Committed by Greg Kroah-Hartman

tty: serial: qcom_geni_serial: Fix UART hang

If a serial console write occured while a UART transmit command was
waiting for a done signal then no further data would be sent until
something new kicked the system into gear. If there is already data
waiting in the circular buffer we must re-enable the tx watermark so we
receive the expected interrupts.
Signed-off-by: default avatarRyan Case <ryandcase@chromium.org>
Reviewed-by: default avatarEvan Green <evgreen@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3c66eb4b
...@@ -440,6 +440,7 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, ...@@ -440,6 +440,7 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s,
bool locked = true; bool locked = true;
unsigned long flags; unsigned long flags;
u32 geni_status; u32 geni_status;
u32 irq_en;
WARN_ON(co->index < 0 || co->index >= GENI_UART_CONS_PORTS); WARN_ON(co->index < 0 || co->index >= GENI_UART_CONS_PORTS);
...@@ -474,6 +475,13 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, ...@@ -474,6 +475,13 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s,
* has been sent, in which case we need to look for done first. * has been sent, in which case we need to look for done first.
*/ */
qcom_geni_serial_poll_tx_done(uport); qcom_geni_serial_poll_tx_done(uport);
if (uart_circ_chars_pending(&uport->state->xmit)) {
irq_en = readl_relaxed(uport->membase +
SE_GENI_M_IRQ_EN);
writel_relaxed(irq_en | M_TX_FIFO_WATERMARK_EN,
uport->membase + SE_GENI_M_IRQ_EN);
}
} }
__qcom_geni_serial_console_write(uport, s, count); __qcom_geni_serial_console_write(uport, s, count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment