From: Greg Kroah-Hartman Date: Thu, 13 Feb 2020 18:31:16 +0000 (-0800) Subject: 4.19-stable patches X-Git-Tag: v4.4.214~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8f85b4b9eaa60bf6d736623c450b4c1f2108f42;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: serial-uartps-move-the-spinlock-after-the-read-of-the-tx-empty.patch --- diff --git a/queue-4.19/serial-uartps-move-the-spinlock-after-the-read-of-the-tx-empty.patch b/queue-4.19/serial-uartps-move-the-spinlock-after-the-read-of-the-tx-empty.patch new file mode 100644 index 00000000000..07f7070e42d --- /dev/null +++ b/queue-4.19/serial-uartps-move-the-spinlock-after-the-read-of-the-tx-empty.patch @@ -0,0 +1,40 @@ +From 107475685abfdee504bb0ef4824f15797f6d2d4d Mon Sep 17 00:00:00 2001 +From: Shubhrajyoti Datta +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 + +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 +Cc: Pavel Machek +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -686,8 +686,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)) { +@@ -699,6 +697,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); diff --git a/queue-4.19/series b/queue-4.19/series index a3d39e11777..8fc9ee4cf12 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -50,3 +50,4 @@ libertas-make-lbs_ibss_join_existing-return-error-co.patch scsi-megaraid_sas-do-not-initiate-ocr-if-controller-is-not-in-ready-state.patch x86-stackframe-move-encode_frame_pointer-to-asm-frame.h.patch x86-stackframe-x86-ftrace-add-pt_regs-frame-annotations.patch +serial-uartps-move-the-spinlock-after-the-read-of-the-tx-empty.patch