]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2020 06:59:14 +0000 (08:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2020 06:59:14 +0000 (08:59 +0200)
added patches:
serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch

queue-4.9/mm-mmap.c-initialize-align_offset-explicitly-for-vm_.patch
queue-4.9/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch [new file with mode: 0644]
queue-4.9/serial-uartps-wait-for-tx_empty-in-console-setup.patch
queue-4.9/series

index 1faae30c1baca3e2dbbf14f39bcdbb6fc3ba35f9..8c1b9730b08056c886fe624a677241deae1eea72 100644 (file)
@@ -34,14 +34,12 @@ Link: http://lkml.kernel.org/r/20200409094035.19457-1-jaewon31.kim@samsung.com
 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- mm/mmap.c | 2 ++
+ mm/mmap.c |    2 ++
  1 file changed, 2 insertions(+)
 
-diff --git a/mm/mmap.c b/mm/mmap.c
-index 7109f886e739e..7c8815636c482 100644
 --- a/mm/mmap.c
 +++ b/mm/mmap.c
-@@ -2028,6 +2028,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
+@@ -2028,6 +2028,7 @@ arch_get_unmapped_area(struct file *filp
        info.low_limit = mm->mmap_base;
        info.high_limit = TASK_SIZE;
        info.align_mask = 0;
@@ -49,7 +47,7 @@ index 7109f886e739e..7c8815636c482 100644
        return vm_unmapped_area(&info);
  }
  #endif
-@@ -2069,6 +2070,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
+@@ -2069,6 +2070,7 @@ arch_get_unmapped_area_topdown(struct fi
        info.low_limit = max(PAGE_SIZE, mmap_min_addr);
        info.high_limit = mm->mmap_base;
        info.align_mask = 0;
@@ -57,6 +55,3 @@ index 7109f886e739e..7c8815636c482 100644
        addr = vm_unmapped_area(&info);
  
        /*
--- 
-2.25.1
-
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
new file mode 100644 (file)
index 0000000..8ebe5f8
--- /dev/null
@@ -0,0 +1,63 @@
+From 277375b864e8147975b064b513f491e2a910e66a Mon Sep 17 00:00:00 2001
+From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
+Date: Fri, 24 May 2019 14:41:29 +0530
+Subject: serial: uartps: Add a timeout to the tx empty wait
+
+From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
+
+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 <jeff.dagenais@gmail.com>
+Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/xilinx_uartps.c |   11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/xilinx_uartps.c
++++ b/drivers/tty/serial/xilinx_uartps.c
+@@ -30,6 +30,7 @@
+ #include <linux/io.h>
+ #include <linux/of.h>
+ #include <linux/module.h>
++#include <linux/iopoll.h>
+ #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,7 +683,8 @@ 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);
+@@ -691,6 +694,12 @@ static void cdns_uart_set_termios(struct
+               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;
+               }
+       }
index db78f25339f20bae92aca5d47d9df3b01da8f3ef..a974a50599263cd1b89ac475d1e624496d1056ba 100644 (file)
@@ -20,14 +20,12 @@ Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.naray
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- drivers/tty/serial/xilinx_uartps.c | 8 ++++++++
+ drivers/tty/serial/xilinx_uartps.c |    8 ++++++++
  1 file changed, 8 insertions(+)
 
-diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
-index eb61a07fcbbc3..07ea71a611678 100644
 --- a/drivers/tty/serial/xilinx_uartps.c
 +++ b/drivers/tty/serial/xilinx_uartps.c
-@@ -1268,6 +1268,7 @@ static int cdns_uart_console_setup(struct console *co, char *options)
+@@ -1277,6 +1277,7 @@ static int cdns_uart_console_setup(struc
        int bits = 8;
        int parity = 'n';
        int flow = 'n';
@@ -35,7 +33,7 @@ index eb61a07fcbbc3..07ea71a611678 100644
  
        if (co->index < 0 || co->index >= CDNS_UART_NR_PORTS)
                return -EINVAL;
-@@ -1281,6 +1282,13 @@ static int cdns_uart_console_setup(struct console *co, char *options)
+@@ -1290,6 +1291,13 @@ static int cdns_uart_console_setup(struc
        if (options)
                uart_parse_options(options, &baud, &parity, &bits, &flow);
  
@@ -49,6 +47,3 @@ index eb61a07fcbbc3..07ea71a611678 100644
        return uart_set_options(port, co, baud, parity, bits, flow);
  }
  
--- 
-2.25.1
-
index bbe745b302ca9af404bc9d7e4c1deb89a4df3c7e..e445344947dc1e70cf45d4411e7d3ff43131dfec 100644 (file)
@@ -72,6 +72,7 @@ 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