aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-xlnx/3.17/tty-xuartps-Fix-RX-hang-and-TX-corruption-in-set_termios.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-xlnx/3.17/tty-xuartps-Fix-RX-hang-and-TX-corruption-in-set_termios.patch')
-rw-r--r--recipes-kernel/linux/linux-xlnx/3.17/tty-xuartps-Fix-RX-hang-and-TX-corruption-in-set_termios.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-xlnx/3.17/tty-xuartps-Fix-RX-hang-and-TX-corruption-in-set_termios.patch b/recipes-kernel/linux/linux-xlnx/3.17/tty-xuartps-Fix-RX-hang-and-TX-corruption-in-set_termios.patch
new file mode 100644
index 00000000..4ac6624d
--- /dev/null
+++ b/recipes-kernel/linux/linux-xlnx/3.17/tty-xuartps-Fix-RX-hang-and-TX-corruption-in-set_termios.patch
@@ -0,0 +1,34 @@
+From c3181f01d21953bff9971e141a193c445099e90f Mon Sep 17 00:00:00 2001
+From: Nathan Rossi <nathan.rossi@xilinx.com>
+Date: Mon, 24 Nov 2014 15:11:43 +1000
+Subject: [PATCH] tty: xuartps: Fix RX hang, and TX corruption in set_termios
+
+Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
+---
+ drivers/tty/serial/xilinx_uartps.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
+index 7f8027f..74dd5c9 100644
+--- a/drivers/tty/serial/xilinx_uartps.c
++++ b/drivers/tty/serial/xilinx_uartps.c
+@@ -628,10 +628,12 @@ static void cdns_uart_set_termios(struct uart_port *port,
+
+ spin_lock_irqsave(&port->lock, flags);
+
+- /* Empty the receive FIFO 1st before making changes */
+- while ((cdns_uart_readl(CDNS_UART_SR_OFFSET) &
+- CDNS_UART_SR_RXEMPTY) != CDNS_UART_SR_RXEMPTY) {
+- cdns_uart_readl(CDNS_UART_FIFO_OFFSET);
++ /* Wait for the transmit FIFO to empty before making changes */
++ if (!(cdns_uart_readl(CDNS_UART_CR_OFFSET) & CDNS_UART_CR_TX_DIS)) {
++ while (!(cdns_uart_readl(CDNS_UART_SR_OFFSET) &
++ CDNS_UART_SR_TXEMPTY)) {
++ cpu_relax();
++ }
+ }
+
+ /* Disable the TX and RX to set baud rate */
+--
+2.1.1
+