linux-yocto/drivers/net/can/spi
Marc Kleine-Budde 3c1c18551e can: mcp251xfd: mcp251xfd_get_tef_len(): fix length calculation
Commit b8e0ddd36c ("can: mcp251xfd: tef: prepare to workaround
broken TEF FIFO tail index erratum") introduced
mcp251xfd_get_tef_len() to get the number of unhandled transmit events
from the Transmit Event FIFO (TEF).

As the TEF has no head pointer, the driver uses the TX FIFO's tail
pointer instead, assuming that send frames are completed. However the
check for the TEF being full was not correct. This leads to the driver
stop working if the TEF is full.

Fix the TEF full check by assuming that if, from the driver's point of
view, there are no free TX buffers in the chip and the TX FIFO is
empty, all messages must have been sent and the TEF must therefore be
full.

Reported-by: Sven Schuchmann <schuchmann@schleissheimer.de>
Closes: https://patch.msgid.link/FR3P281MB155216711EFF900AD9791B7ED9692@FR3P281MB1552.DEUP281.PROD.OUTLOOK.COM
Fixes: b8e0ddd36c ("can: mcp251xfd: tef: prepare to workaround broken TEF FIFO tail index erratum")
Tested-by: Sven Schuchmann <schuchmann@schleissheimer.de>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20241104-mcp251xfd-fix-length-calculation-v3-1-608b6e7e2197@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2024-11-04 18:01:07 +01:00
..
mcp251xfd can: mcp251xfd: mcp251xfd_get_tef_len(): fix length calculation 2024-11-04 18:01:07 +01:00
hi311x.c can: hi311x: simplify with spi_get_device_match_data() 2024-06-21 09:46:38 +02:00
Kconfig
Makefile
mcp251x.c can: mcp251x: fix deadlock if an interrupt occurs during mcp251x_open 2024-08-22 09:47:09 +02:00