]>
Commit | Line | Data |
---|---|---|
4c527995 GKH |
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 | |
5 | ||
6 | From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> | |
7 | ||
8 | commit 61c0e37950b88bad590056286c1d766b1f167f4e upstream. | |
9 | ||
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). | |
15 | ||
16 | This patch replaces the PIO byte accessor with the word accessor | |
17 | already used in PIO mode. | |
18 | ||
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> | |
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; |