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;
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;
addr = vm_unmapped_area(&info);
/*
---
-2.25.1
-
--- /dev/null
+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;
+ }
+ }
+
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';
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);
return uart_set_options(port, co, baud, parity, bits, flow);
}
---
-2.25.1
-
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