From: Greg Kroah-Hartman Date: Thu, 1 Oct 2020 09:09:40 +0000 (+0200) Subject: drop some uartps patches from 4.9 X-Git-Tag: v4.4.238~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01aac218aaa7ad6400fd830f919876dcc2e3e699;p=thirdparty%2Fkernel%2Fstable-queue.git drop some uartps patches from 4.9 --- diff --git a/queue-4.9/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch b/queue-4.9/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch deleted file mode 100644 index 6e7bdf7f4ef..00000000000 --- a/queue-4.9/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 277375b864e8147975b064b513f491e2a910e66a Mon Sep 17 00:00:00 2001 -From: Shubhrajyoti Datta -Date: Fri, 24 May 2019 14:41:29 +0530 -Subject: serial: uartps: Add a timeout to the tx empty wait - -From: Shubhrajyoti Datta - -commit 277375b864e8147975b064b513f491e2a910e66a upstream. - -In case the cable is not connected then the target gets into -an infinite wait for tx empty. -Add a timeout to the tx empty wait. - -Reported-by: Jean-Francois Dagenais -Signed-off-by: Shubhrajyoti Datta -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/tty/serial/xilinx_uartps.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - ---- a/drivers/tty/serial/xilinx_uartps.c -+++ b/drivers/tty/serial/xilinx_uartps.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #define CDNS_UART_TTY_NAME "ttyPS" - #define CDNS_UART_NAME "xuartps" -@@ -38,6 +39,7 @@ - #define CDNS_UART_NR_PORTS 2 - #define CDNS_UART_FIFO_SIZE 64 /* FIFO size */ - #define CDNS_UART_REGISTER_SPACE 0x1000 -+#define TX_TIMEOUT 500000 - - /* Rx Trigger level */ - static int rx_trigger_level = 56; -@@ -681,16 +683,20 @@ static void cdns_uart_set_termios(struct - unsigned int cval = 0; - unsigned int baud, minbaud, maxbaud; - unsigned long flags; -- unsigned int ctrl_reg, mode_reg; -+ unsigned int ctrl_reg, mode_reg, val; -+ int err; - - spin_lock_irqsave(&port->lock, flags); - - /* Wait for the transmit FIFO to empty before making changes */ - if (!(readl(port->membase + CDNS_UART_CR) & - CDNS_UART_CR_TX_DIS)) { -- while (!(readl(port->membase + CDNS_UART_SR) & -- CDNS_UART_SR_TXEMPTY)) { -- cpu_relax(); -+ err = readl_poll_timeout(port->membase + CDNS_UART_SR, -+ val, (val & CDNS_UART_SR_TXEMPTY), -+ 1000, TX_TIMEOUT); -+ if (err) { -+ dev_err(port->dev, "timed out waiting for tx empty"); -+ return; - } - } - diff --git a/queue-4.9/serial-uartps-wait-for-tx_empty-in-console-setup.patch b/queue-4.9/serial-uartps-wait-for-tx_empty-in-console-setup.patch deleted file mode 100644 index 612878bb548..00000000000 --- a/queue-4.9/serial-uartps-wait-for-tx_empty-in-console-setup.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 54340d4d8bd85b2c432243ab4d6e23d954303493 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 9 Apr 2020 11:56:02 +0530 -Subject: serial: uartps: Wait for tx_empty in console setup - -From: Raviteja Narayanam - -[ Upstream commit 42e11948ddf68b9f799cad8c0ddeab0a39da33e8 ] - -On some platforms, the log is corrupted while console is being -registered. It is observed that when set_termios is called, there -are still some bytes in the FIFO to be transmitted. - -So, wait for tx_empty inside cdns_uart_console_setup before calling -set_termios. - -Signed-off-by: Raviteja Narayanam -Reviewed-by: Shubhrajyoti Datta -Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.narayanam@xilinx.com -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Sasha Levin ---- - drivers/tty/serial/xilinx_uartps.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - ---- a/drivers/tty/serial/xilinx_uartps.c -+++ b/drivers/tty/serial/xilinx_uartps.c -@@ -1274,6 +1274,7 @@ static int cdns_uart_console_setup(struc - int bits = 8; - int parity = 'n'; - int flow = 'n'; -+ unsigned long time_out; - - if (co->index < 0 || co->index >= CDNS_UART_NR_PORTS) - return -EINVAL; -@@ -1287,6 +1288,13 @@ static int cdns_uart_console_setup(struc - if (options) - uart_parse_options(options, &baud, &parity, &bits, &flow); - -+ /* Wait for tx_empty before setting up the console */ -+ time_out = jiffies + usecs_to_jiffies(TX_TIMEOUT); -+ -+ while (time_before(jiffies, time_out) && -+ cdns_uart_tx_empty(port) != TIOCSER_TEMT) -+ cpu_relax(); -+ - return uart_set_options(port, co, baud, parity, bits, flow); - } - diff --git a/queue-4.9/series b/queue-4.9/series index bcdbcce1631..b7414fc20f8 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -72,8 +72,6 @@ ubifs-fix-out-of-bounds-memory-access-caused-by-abno.patch alsa-usb-audio-fix-case-when-usb-midi-interface-has-.patch mm-filemap.c-clear-page-error-before-actual-read.patch mm-mmap.c-initialize-align_offset-explicitly-for-vm_.patch -serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch -serial-uartps-wait-for-tx_empty-in-console-setup.patch kvm-remove-create_irqchip-set_pit2-race.patch bdev-reduce-time-holding-bd_mutex-in-sync-in-blkdev_.patch drivers-char-tlclk.c-avoid-data-race-between-init-an.patch