1 From 61c0e37950b88bad590056286c1d766b1f167f4e Mon Sep 17 00:00:00 2001
2 From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
3 Date: Mon, 20 May 2019 20:38:48 +0200
4 Subject: tty: serial: msm_serial: Fix XON/XOFF
6 From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
8 commit 61c0e37950b88bad590056286c1d766b1f167f4e upstream.
10 When the tty layer requests the uart to throttle, the current code
11 executing in msm_serial will trigger "Bad mode in Error Handler" and
12 generate an invalid stack frame in pstore before rebooting (that is if
13 pstore is indeed configured: otherwise the user shall just notice a
14 reboot with no further information dumped to the console).
16 This patch replaces the PIO byte accessor with the word accessor
17 already used in PIO mode.
19 Fixes: 68252424a7c7 ("tty: serial: msm: Support big-endian CPUs")
20 Cc: stable@vger.kernel.org
21 Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
22 Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
23 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27 drivers/tty/serial/msm_serial.c | 5 ++++-
28 1 file changed, 4 insertions(+), 1 deletion(-)
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 };
40 @@ -877,10 +878,12 @@ static void msm_handle_tx(struct uart_po
42 tf = port->membase + UART_TF;
44 + buf[0] = port->x_char;
46 if (msm_port->is_uartdm)
47 msm_reset_dm_count(port, 1);
49 - iowrite8_rep(tf, &port->x_char, 1);
50 + iowrite32_rep(tf, buf, 1);