diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2020-01-21 10:17:02 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-22 12:22:31 +0300 |
commit | 101aa46bd221b768dfff8ef3745173fc8dbb85ee (patch) | |
tree | b5f56b03ed8669053ed21b23ef38556365412e46 /drivers/tty/serial/earlycon.c | |
parent | 48d414a3f2ecd995b65e52df3f8d6b5d0e8d026b (diff) | |
download | linux-101aa46bd221b768dfff8ef3745173fc8dbb85ee.tar.xz |
serial: imx: fix a race condition in receive path
The main irq handler function starts by first masking disabled
interrupts in the status register values to ensure to only handle
enabled interrupts. This is important as when the RX path in the
hardware is disabled reading the RX fifo results in an external abort.
This checking must be done under the port lock, otherwise the following
can happen:
CPU1 | CPU2
|
irq triggers as there are chars |
in the RX fifo |
| grab port lock
imx_uart_int finds RRDY enabled |
and calls imx_uart_rxint which |
has to wait for port lock |
| disable RX (e.g. because we're
| using RS485 with !RX_DURING_TX)
|
| release port lock
read from RX fifo with RX |
disabled => exception |
So take the port lock only once in imx_uart_int() instead of in the
functions called from there.
Reported-by: Andre Renaud <arenaud@designa-electronics.com>
Cc: stable@vger.kernel.org
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20200121071702.20150-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/earlycon.c')
0 files changed, 0 insertions, 0 deletions