]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.9/tty-serial-msm_serial-fix-xon-xoff.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.9 / tty-serial-msm_serial-fix-xon-xoff.patch
CommitLineData
4c527995
GKH
1From 61c0e37950b88bad590056286c1d766b1f167f4e Mon Sep 17 00:00:00 2001
2From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
3Date: Mon, 20 May 2019 20:38:48 +0200
4Subject: tty: serial: msm_serial: Fix XON/XOFF
5
6From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
7
8commit 61c0e37950b88bad590056286c1d766b1f167f4e upstream.
9
10When the tty layer requests the uart to throttle, the current code
11executing in msm_serial will trigger "Bad mode in Error Handler" and
12generate an invalid stack frame in pstore before rebooting (that is if
13pstore is indeed configured: otherwise the user shall just notice a
14reboot with no further information dumped to the console).
15
16This patch replaces the PIO byte accessor with the word accessor
17already used in PIO mode.
18
19Fixes: 68252424a7c7 ("tty: serial: msm: Support big-endian CPUs")
20Cc: stable@vger.kernel.org
21Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
22Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
23Reviewed-by: Stephen Boyd <swboyd@chromium.org>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25
26---
27 drivers/tty/serial/msm_serial.c | 5 ++++-
28 1 file changed, 4 insertions(+), 1 deletion(-)
29
30--- a/drivers/tty/serial/msm_serial.c
31+++ b/drivers/tty/serial/msm_serial.c
32@@ -868,6 +868,7 @@ static void msm_handle_tx(struct uart_po
33 struct circ_buf *xmit = &msm_port->uart.state->xmit;
34 struct msm_dma *dma = &msm_port->tx_dma;
35 unsigned int pio_count, dma_count, dma_min;
36+ char buf[4] = { 0 };
37 void __iomem *tf;
38 int err = 0;
39
40@@ -877,10 +878,12 @@ static void msm_handle_tx(struct uart_po
41 else
42 tf = port->membase + UART_TF;
43
44+ buf[0] = port->x_char;
45+
46 if (msm_port->is_uartdm)
47 msm_reset_dm_count(port, 1);
48
49- iowrite8_rep(tf, &port->x_char, 1);
50+ iowrite32_rep(tf, buf, 1);
51 port->icount.tx++;
52 port->x_char = 0;
53 return;