diff options
author | 2021-01-05 22:41:37 +0100 | |
---|---|---|
committer | 2021-01-07 11:02:09 +0100 | |
commit | 6086f02a18aeae795a61a3fc6566920891ea3b52 (patch) | |
tree | 04f48e96a19969683435af85fc4115bb33c850b5 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | can: tcan4x5x: fix bittiming const, use common bittiming from m_can driver (diff) | |
download | linux-dev-6086f02a18aeae795a61a3fc6566920891ea3b52.tar.xz linux-dev-6086f02a18aeae795a61a3fc6566920891ea3b52.zip |
can: mcp251xfd: mcp251xfd_handle_tefif(): fix TEF vs. TX race condition
The mcp251xfd driver uses a TX FIFO for sending CAN frames and a TX Event FIFO
(TEF) for completed TX-requests.
The TEF event handling in the mcp251xfd_handle_tefif() function has a race
condition. It first increments the tx-ring's tail counter to signal that
there's room in the TX and TEF FIFO, then it increments the TEF FIFO in
hardware.
A running mcp251xfd_start_xmit() on a different CPU might not stop the txqueue
(as the tx-ring still shows free space). The next mcp251xfd_start_xmit() will
push a message into the chip and the TX complete event might overflow the TEF
FIFO.
This patch changes the order to fix the problem.
Fixes: 68c0c1c7f966 ("can: mcp251xfd: tef-path: reduce number of SPI core requests to set UINC bit")
Link: https://lore.kernel.org/r/20210105214138.3150886-2-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions