summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMark Deneen <mdeneen@gmail.com>2014-01-07 11:45:09 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-06 11:33:59 -0800
commitd7f2686ed1afc2aa3a5a37c493aa8be977554d0b (patch)
tree73d34a416dfc975e934700cae7731202100b80cd /drivers
parentbe08a62a7708f420431a85e57e8044efdf081552 (diff)
tty/serial: at91: reset rx_ring when port is shutdown
commit bb7e73c598fb226c75f7625088a8f6a45a0fc892 upstream. 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 <mdeneen@gmail.com> Acked-by: Leilei Zhao <leilei.zhao@atmel.com> [nicolas.ferre@atmel.com: adapt to mainline kernel, handle !DMA case] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/atmel_serial.c6
1 files changed, 6 insertions, 0 deletions
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);