Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751160AbbGaAvO (ORCPT ); Thu, 30 Jul 2015 20:51:14 -0400 Received: from mail-qg0-f52.google.com ([209.85.192.52]:33180 "EHLO mail-qg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbbGaAvM (ORCPT ); Thu, 30 Jul 2015 20:51:12 -0400 Message-ID: <55BAC67E.1010400@hurleysoftware.com> Date: Thu, 30 Jul 2015 20:51:10 -0400 From: Peter Hurley User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: John Ogness CC: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Tony Lindgren , Sebastian Andrzej Siewior , linux-omap@vger.kernel.org, nsekhar@ti.com, nm@ti.com, linux-serial@vger.kernel.org Subject: Re: [PATCH 3/3] serial: 8250: omap: restore registers on shutdown References: <87egjp2r4a.fsf@linutronix.de> In-Reply-To: <87egjp2r4a.fsf@linutronix.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1517 Lines: 51 Hi John, On 07/30/2015 06:54 PM, John Ogness wrote: > If DMA is active during a shutdown, a delayed restore of the > registers may be pending. The restore must be performed after > the DMA is stopped, otherwise the delayed restore remains > pending and will fire upon the first DMA TX complete of a > totally different serial session. > > Signed-off-by: John Ogness > --- > drivers/tty/serial/8250/8250_omap.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c > index 5b39892..25f6255 100644 > --- a/drivers/tty/serial/8250/8250_omap.c > +++ b/drivers/tty/serial/8250/8250_omap.c > @@ -657,9 +657,15 @@ static void omap_8250_shutdown(struct uart_port *port) > up->ier = 0; > serial_out(up, UART_IER, 0); > > - if (up->dma) > + if (up->dma) { > serial8250_release_dma(up); > > + if (priv->delayed_restore) { > + priv->delayed_restore = 0; > + omap8250_restore_regs(up); > + } I was never really a fan of the deferred set_termios(); I think it's more appropriate to wait for tx dma to complete in omap_8250_set_termios(). Regards, Peter Hurley > + } > + > /* > * Disable break condition and FIFOs > */ > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/