Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315110 > unrolled thread

[PATCH REPOST] tty: serial: 8250: omap: restore registers on shutdown

Started byJohn Ogness <john.ogness@linutronix.de>
First post2016-01-22 17:30 +0100
Last post2016-01-23 22:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH REPOST] tty: serial: 8250: omap: restore registers on shutdown John Ogness <john.ogness@linutronix.de> - 2016-01-22 17:30 +0100
    Re: [PATCH REPOST] tty: serial: 8250: omap: restore registers on  shutdown Peter Hurley <peter@hurleysoftware.com> - 2016-01-23 22:30 +0100

#1315110 — [PATCH REPOST] tty: serial: 8250: omap: restore registers on shutdown

FromJohn Ogness <john.ogness@linutronix.de>
Date2016-01-22 17:30 +0100
Subject[PATCH REPOST] tty: serial: 8250: omap: restore registers on shutdown
Message-ID<qTML0-6v3-3@gated-at.bofh.it>
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.

 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
 	 */
-- 
1.7.10.4

[toc] | [next] | [standalone]


#1315761 — Re: [PATCH REPOST] tty: serial: 8250: omap: restore registers on shutdown

FromPeter Hurley <peter@hurleysoftware.com>
Date2016-01-23 22:30 +0100
SubjectRe: [PATCH REPOST] tty: serial: 8250: omap: restore registers on shutdown
Message-ID<qUdUS-27N-3@gated-at.bofh.it>
In reply to#1315110
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
>  	 */
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web