Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: zs: Fix a transmit lockup in console output

Transmit interrupts are disabled and the transmit buffer drained in the
course of console output so that polled transmission is possible. That
however causes a lost transmit interrupt as the TxIP bit in RR3 is only
set on a transmit buffer full-to-empty transition and then iff transmit
interrupts are enabled at the same time. Consequently if console output
disturbs a regular transmission in progress, the TxIP bit is never set
again and the transmission locks up waiting for a transmit interrupt.

Fix the problem by restarting transmission manually rather than waiting
for a transmit interrupt that will never happen.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Maciej W. Rozycki and committed by
Greg Kroah-Hartman
fff21fac bdc5f300

+4
+4
drivers/tty/serial/zs.c
··· 1181 1181 if (txint & TxINT_ENAB) { 1182 1182 zport->regs[1] |= TxINT_ENAB; 1183 1183 write_zsreg(zport, R1, zport->regs[1]); 1184 + 1185 + /* Resume any transmission as the TxIP bit won't be set. */ 1186 + if (!zport->tx_stopped) 1187 + zs_raw_transmit_chars(zport); 1184 1188 } 1185 1189 spin_unlock_irqrestore(&scc->zlock, flags); 1186 1190 }