diff options
| author | Nathan Rossi <nathan.rossi@xilinx.com> | 2015-03-02 15:59:27 +1000 |
|---|---|---|
| committer | Nathan Rossi <nathan.rossi@xilinx.com> | 2015-03-31 15:56:46 +1000 |
| commit | a864f597d8604ea77b9bcb8e406cbd403866702f (patch) | |
| tree | b0709026de16ab24061ca94330e5cea9b9d69209 /recipes-kernel | |
| parent | 1d3fe7ffab6d072fc536c28c6df9b8a3c6d3f187 (diff) | |
| download | meta-xilinx-a864f597d8604ea77b9bcb8e406cbd403866702f.tar.gz | |
linux-yocto: Add append for the 3.19 kernel
* Create the bbappend for the 3.19 kernel, add similar config as other
linux-yocto appends
* Add the uartps fix, this is the patch backported from the Linux 4.0
kernel
Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Diffstat (limited to 'recipes-kernel')
| -rw-r--r-- | recipes-kernel/linux/linux-xlnx/3.19/tty-xuartps-Fix-RX-hang-and-TX-corruption-in-termios.patch | 62 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-yocto_3.19.bbappend | 9 |
2 files changed, 71 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-xlnx/3.19/tty-xuartps-Fix-RX-hang-and-TX-corruption-in-termios.patch b/recipes-kernel/linux/linux-xlnx/3.19/tty-xuartps-Fix-RX-hang-and-TX-corruption-in-termios.patch new file mode 100644 index 00000000..8ae7b85a --- /dev/null +++ b/recipes-kernel/linux/linux-xlnx/3.19/tty-xuartps-Fix-RX-hang-and-TX-corruption-in-termios.patch | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | From 6ecde472b0d943251f8f348155495391720b61b0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Nathan Rossi <nathan.rossi@xilinx.com> | ||
| 3 | Date: Fri, 16 Jan 2015 13:49:25 +0100 | ||
| 4 | Subject: [PATCH] tty: xuartps: Fix RX hang, and TX corruption in termios call | ||
| 5 | |||
| 6 | The implementation of flushing the RX FIFO breaks in a number of cases, | ||
| 7 | it is impossible to ensure an complete flush of the RX FIFO due to the | ||
| 8 | hardware not allowing the use of the FIFOs when the receiver is disabled | ||
| 9 | (Reading from the FIFO register does not remove it from the FIFO when | ||
| 10 | the RX_EN=0 or RX_DIS=1). Additionally during an initial set_termios | ||
| 11 | call where RX_DIS=1 causes a hang waiting forever for the RX FIFO to | ||
| 12 | empty. On top of this the FIFO will be cleared by the use of the RXRST | ||
| 13 | bits on the Control Register, making the RX flush pointless (as it does | ||
| 14 | not preserve the data read anyway). | ||
| 15 | |||
| 16 | Due to the TXRST the TX FIFO and transmitter can be interrupted during | ||
| 17 | frame trasmission, causing corruption and additionally data lost in the | ||
| 18 | FIFO. Most other serial drivers do not flush or clear the FIFOs during | ||
| 19 | a termios configuration change and as such do not have issues with | ||
| 20 | corruption. For this UART controller is it required that the TXRST/RXRST | ||
| 21 | bit be flagged during the change, this means that the data in the FIFO | ||
| 22 | will be dropped when changing configuration. In order to prevent data | ||
| 23 | loss and corruption of the transmitted data, wait until the TX FIFO is | ||
| 24 | empty before changing the configuration. The performance of this may | ||
| 25 | cause the set_termios call to take a longer amount of time especially | ||
| 26 | on lower baud rates, however it is comparable to the same performance | ||
| 27 | hit that a console_write call costs. | ||
| 28 | |||
| 29 | Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com> | ||
| 30 | Acked-by: Anirudha Sarangi <anirudh@xilinx.com> | ||
| 31 | Acked-by: Harini Katakam <harinik@xilinx.com> | ||
| 32 | Signed-off-by: Michal Simek <michal.simek@xilinx.com> | ||
| 33 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
| 34 | Upstream-Status: Backport [Available in 4.0] | ||
| 35 | --- | ||
| 36 | drivers/tty/serial/xilinx_uartps.c | 10 ++++++---- | ||
| 37 | 1 file changed, 6 insertions(+), 4 deletions(-) | ||
| 38 | |||
| 39 | diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c | ||
| 40 | index 542bab3..cff531a 100644 | ||
| 41 | --- a/drivers/tty/serial/xilinx_uartps.c | ||
| 42 | +++ b/drivers/tty/serial/xilinx_uartps.c | ||
| 43 | @@ -637,10 +637,12 @@ static void cdns_uart_set_termios(struct uart_port *port, | ||
| 44 | |||
| 45 | spin_lock_irqsave(&port->lock, flags); | ||
| 46 | |||
| 47 | - /* Empty the receive FIFO 1st before making changes */ | ||
| 48 | - while ((cdns_uart_readl(CDNS_UART_SR_OFFSET) & | ||
| 49 | - CDNS_UART_SR_RXEMPTY) != CDNS_UART_SR_RXEMPTY) { | ||
| 50 | - cdns_uart_readl(CDNS_UART_FIFO_OFFSET); | ||
| 51 | + /* Wait for the transmit FIFO to empty before making changes */ | ||
| 52 | + if (!(cdns_uart_readl(CDNS_UART_CR_OFFSET) & CDNS_UART_CR_TX_DIS)) { | ||
| 53 | + while (!(cdns_uart_readl(CDNS_UART_SR_OFFSET) & | ||
| 54 | + CDNS_UART_SR_TXEMPTY)) { | ||
| 55 | + cpu_relax(); | ||
| 56 | + } | ||
| 57 | } | ||
| 58 | |||
| 59 | /* Disable the TX and RX to set baud rate */ | ||
| 60 | -- | ||
| 61 | 1.7.10.4 | ||
| 62 | |||
diff --git a/recipes-kernel/linux/linux-yocto_3.19.bbappend b/recipes-kernel/linux/linux-yocto_3.19.bbappend new file mode 100644 index 00000000..77f02833 --- /dev/null +++ b/recipes-kernel/linux/linux-yocto_3.19.bbappend | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | |||
| 2 | require linux-xilinx-configs.inc | ||
| 3 | require linux-xilinx-machines.inc | ||
| 4 | |||
| 5 | FILESEXTRAPATHS_prepend := "${THISDIR}/linux-xlnx/3.19:" | ||
| 6 | SRC_URI_append_zynq += " \ | ||
| 7 | file://tty-xuartps-Fix-RX-hang-and-TX-corruption-in-termios.patch \ | ||
| 8 | " | ||
| 9 | |||
