This is a note to let you know that I've just added the patch titled
tty/serial: at91: reset rx_ring when port is shutdown
to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-next branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will also be merged in the next major kernel release
during the merge window.
If you have any questions about this process, please let me know.
>From bb7e73c598fb226c75f7625088a8f6a45a0fc892 Mon Sep 17 00:00:00 2001
From: Mark Deneen <[email protected]>
Date: Tue, 7 Jan 2014 11:45:09 +0100
Subject: tty/serial: at91: reset rx_ring when port is shutdown
When using RX DMA, the driver won't pass any data to the uart layer
until the buffer is flipped. When the port is shutdown, the dma buffers
are unmapped, but the head and tail of the ring buffer are not reseted.
Since the serial console will keep the port open, this will only
present itself when the uart is not shared.
To reproduce the issue, with an unpatched driver, run a getty on /dev/ttyS0
with no serial console and exit. Getty will exit, and when the new one returns
you will be unable to log in. If you hold down a key long enough to fill the
DMA buffer and flip it, you can then log in.
Signed-off-by: Mark Deneen <[email protected]>
Acked-by: Leilei Zhao <[email protected]>
[[email protected]: adapt to mainline kernel, handle !DMA case]
Cc: <[email protected]> # v3.12
Signed-off-by: Nicolas Ferre <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/tty/serial/atmel_serial.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/tty/serial/atmel_serial.c
b/drivers/tty/serial/atmel_serial.c
index c421d11b3d4c..2b6ac1be00d3 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1677,6 +1677,12 @@ static void atmel_shutdown(struct uart_port *port)
atmel_port->release_tx(port);
/*
+ * Reset ring buffer pointers
+ */
+ atmel_port->rx_ring.head = 0;
+ atmel_port->rx_ring.tail = 0;
+
+ /*
* Free the interrupt
*/
free_irq(port->irq, port);
--
1.8.5.1.163.gd7aced9
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html