linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: John Ogness <john.ogness@linutronix.de>, gregkh@linuxfoundation.org
Cc: bigeasy@linutronix.de, tony@atomide.com, nsekhar@ti.com,
	peter.ujfalusi@ti.com, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH REPOST] tty: serial: 8250: omap: restore registers on shutdown
Date: Sat, 23 Jan 2016 13:25:17 -0800	[thread overview]
Message-ID: <56A3EFBD.9020209@hurleysoftware.com> (raw)
In-Reply-To: <87vb6llgst.fsf@linutronix.de>

On 01/22/2016 08:28 AM, 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 <john.ogness@linutronix.de>
> ---
>  This patch was originally posted and discussed here:
>  http://lkml.kernel.org/r/87egjp2r4a.fsf@linutronix.de
> 
>  The patch was not accepted because Peter expressed dissatisfaction with
>  the entire deferred implementation. (This patch fixes a bug in that
>  implementation.) However, no alternative solution was determined and the
>  bug continues to exist.

Yeah, I made that comment a while ago and still no one's fixed that.
What gives?

Regards,
Peter Hurley


>  Although we can certainly continue to debate about an alternate solution
>  to the deferred implementation, I think it makes sense to at least fix
>  the existing bug until an alternative exists.
> 
>  The bug can be easily produced with a `kill -9` on a process transmitting
>  on the serial port.
> 
>  patch against next-20160122
> 
>  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 a2c0734..0ffec67 100644
> --- a/drivers/tty/serial/8250/8250_omap.c
> +++ b/drivers/tty/serial/8250/8250_omap.c
> @@ -664,9 +664,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);
> +		}
> +	}
> +
>  	/*
>  	 * Disable break condition and FIFOs
>  	 */
> 

      reply	other threads:[~2016-01-23 21:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22 16:28 [PATCH REPOST] tty: serial: 8250: omap: restore registers on shutdown John Ogness
2016-01-23 21:25 ` Peter Hurley [this message]

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=56A3EFBD.9020209@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=tony@atomide.com \
    /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;
as well as URLs for NNTP newsgroup(s).