linux/drivers/net/can
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
..
c_can can: c_can: fix {rx,tx}_errors statistics 2024-11-04 18:01:06 +01:00
cc770 can: {cc770,sja1000}_isa: allow building on x86_64 2024-11-04 17:46:06 +01:00
ctucanfd can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
dev
esd
flexcan can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
ifi_canfd can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
m_can can: m_can: m_can_close(): don't call free_irq() for IRQ-less devices 2024-11-04 18:01:06 +01:00
mscan can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
peak_canfd
rcar can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
rockchip can: rockchip_canfd: Drop obsolete dependency on COMPILE_TEST 2024-11-04 18:01:06 +01:00
sja1000 can: {cc770,sja1000}_isa: allow building on x86_64 2024-11-04 17:46:06 +01:00
slcan
softing can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
spi can: mcp251xfd: mcp251xfd_get_tef_len(): fix length calculation 2024-11-04 18:01:07 +01:00
usb move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
at91_can.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
bxcan.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
can327.c
grcan.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
janz-ican3.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
Kconfig
kvaser_pciefd.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-09-15 09:13:19 -07:00
Makefile
sun4i_can.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
ti_hecc.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
vcan.c
vxcan.c
xilinx_can.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00