From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753474AbcA3JPN (ORCPT ); Sat, 30 Jan 2016 04:15:13 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:34312 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752001AbcA3JPA (ORCPT ); Sat, 30 Jan 2016 04:15:00 -0500 Date: Sat, 30 Jan 2016 09:11:46 +0000 (GMT) From: "Maciej W. Rozycki" To: Greg Kroah-Hartman cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] serial: zs: Fix a transmit lockup in console output Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); }