]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2020 18:31:10 +0000 (10:31 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2020 18:31:10 +0000 (10:31 -0800)
added patches:
serial-uartps-move-the-spinlock-after-the-read-of-the-tx-empty.patch

queue-4.14/serial-uartps-move-the-spinlock-after-the-read-of-the-tx-empty.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/serial-uartps-move-the-spinlock-after-the-read-of-the-tx-empty.patch b/queue-4.14/serial-uartps-move-the-spinlock-after-the-read-of-the-tx-empty.patch
new file mode 100644 (file)
index 0000000..ac5de9e
--- /dev/null
@@ -0,0 +1,40 @@
+From 107475685abfdee504bb0ef4824f15797f6d2d4d Mon Sep 17 00:00:00 2001
+From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
+Date: Fri, 24 May 2019 14:41:28 +0530
+Subject: serial: uartps: Move the spinlock after the read of the tx empty
+
+From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
+
+commit 107475685abfdee504bb0ef4824f15797f6d2d4d upstream.
+
+Currently we are doing a read of the status register.
+Move the spinlock after that as the reads need not be spinlock
+protected. This patch prevents relaxing the cpu with spinlock held.
+
+Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
+Cc: Pavel Machek <pavel@denx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/xilinx_uartps.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/tty/serial/xilinx_uartps.c
++++ b/drivers/tty/serial/xilinx_uartps.c
+@@ -690,8 +690,6 @@ static void cdns_uart_set_termios(struct
+       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)) {
+@@ -703,6 +701,7 @@ static void cdns_uart_set_termios(struct
+                       return;
+               }
+       }
++      spin_lock_irqsave(&port->lock, flags);
+       /* Disable the TX and RX to set baud rate */
+       ctrl_reg = readl(port->membase + CDNS_UART_CR);
index e8549eec34bcbb3002dd2007d09f19958a5d3025..9c5e1e507b155d7b01ec53a9233954136b2fb6d1 100644 (file)
@@ -167,6 +167,7 @@ media-i2c-adv748x-fix-unsafe-macros.patch
 pinctrl-sh-pfc-r8a7778-fix-duplicate-sdself_b-and-sd1_clk_b.patch
 scsi-megaraid_sas-do-not-initiate-ocr-if-controller-is-not-in-ready-state.patch
 dm-fix-potential-for-q-make_request_fn-null-pointer.patch
+serial-uartps-move-the-spinlock-after-the-read-of-the-tx-empty.patch
 mwifiex-fix-possible-buffer-overflows-in-mwifiex_ret.patch
 mwifiex-fix-possible-buffer-overflows-in-mwifiex_cmd.patch
 libertas-don-t-exit-from-lbs_ibss_join_existing-with.patch