From: Greg Kroah-Hartman Date: Tue, 29 Sep 2020 06:59:14 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.4.238~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=92703d5f67e173986fef8f394ebf44360f0913f9;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch --- diff --git a/queue-4.9/mm-mmap.c-initialize-align_offset-explicitly-for-vm_.patch b/queue-4.9/mm-mmap.c-initialize-align_offset-explicitly-for-vm_.patch index 1faae30c1ba..8c1b9730b08 100644 --- a/queue-4.9/mm-mmap.c-initialize-align_offset-explicitly-for-vm_.patch +++ b/queue-4.9/mm-mmap.c-initialize-align_offset-explicitly-for-vm_.patch @@ -34,14 +34,12 @@ Link: http://lkml.kernel.org/r/20200409094035.19457-1-jaewon31.kim@samsung.com Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- - 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 index 00000000000..8ebe5f851b0 --- /dev/null +++ b/queue-4.9/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch @@ -0,0 +1,63 @@ +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 | 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 + #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,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; + } + } + 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 index db78f25339f..a974a505992 100644 --- 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 @@ -20,14 +20,12 @@ Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.naray Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- - 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 - diff --git a/queue-4.9/series b/queue-4.9/series index bbe745b302c..e445344947d 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -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