diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-01-05 22:41:37 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-01-07 11:02:09 +0100 |
commit | 6086f02a18aeae795a61a3fc6566920891ea3b52 (patch) | |
tree | 04f48e96a19969683435af85fc4115bb33c850b5 /drivers/net/phy/xilinx_gmii2rgmii.c | |
parent | aee2b3ccc8a63d1cd7da6a8a153d1f3712d40826 (diff) |
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 'drivers/net/phy/xilinx_gmii2rgmii.c')
0 files changed, 0 insertions, 0 deletions