mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] serial: zs: Fix a transmit lockup in console output
Date: Sat, 30 Jan 2016 09:11:46 +0000 (GMT)	[thread overview]
Message-ID: <alpine.LFD.2.20.1601300840380.13722@eddie.linux-mips.org> (raw)

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>
---
linux-mips-dec-zs-console-transmit.diff
Index: linux-20150524-4maxp64/drivers/tty/serial/zs.c
===================================================================
--- linux-20150524-4maxp64.orig/drivers/tty/serial/zs.c
+++ linux-20150524-4maxp64/drivers/tty/serial/zs.c
@@ -1181,6 +1181,10 @@ static void zs_console_write(struct cons
 	if (txint & TxINT_ENAB) {
 		zport->regs[1] |= TxINT_ENAB;
 		write_zsreg(zport, R1, zport->regs[1]);
+
+		/* Resume any transmission as the TxIP bit won't be set.  */
+		if (!zport->tx_stopped)
+			zs_raw_transmit_chars(zport);
 	}
 	spin_unlock_irqrestore(&scc->zlock, flags);
 }

                 reply	other threads:[~2016-01-30  9:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.20.1601300840380.13722@eddie.linux-mips.org \
    --to=macro@linux-mips.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®