diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2023-01-22 21:30:41 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2024-06-28 23:48:12 +0200 |
commit | b8e0ddd36ce9536ad7478dd27df06c9ae92370ba (patch) | |
tree | 22e8ea0af8960660293bed6aa3a4b6bbe242751c /drivers/net/caif | |
parent | can: mcp251xfd: rx: add workaround for erratum DS80000789E 6 of mcp2518fd (diff) | |
download | linux-b8e0ddd36ce9536ad7478dd27df06c9ae92370ba.tar.xz linux-b8e0ddd36ce9536ad7478dd27df06c9ae92370ba.zip |
can: mcp251xfd: tef: prepare to workaround broken TEF FIFO tail index erratum
This is a preparatory patch to work around a problem similar to
erratum DS80000789E 6 of the mcp2518fd, the other variants of the chip
family (mcp2517fd and mcp251863) are probably also affected.
Erratum DS80000789E 6 says "reading of the FIFOCI bits in the FIFOSTA
register for an RX FIFO may be corrupted". However observation shows
that this problem is not limited to RX FIFOs but also effects the TEF
FIFO.
When handling the TEF interrupt, the driver reads the FIFO header
index from the TEF FIFO STA register of the chip.
In the bad case, the driver reads a too large head index. In the
original code, the driver always trusted the read value, which caused
old CAN transmit complete events that were already processed to be
re-processed.
Instead of reading and trusting the head index, read the head index
and calculate the number of CAN frames that were supposedly received -
replace mcp251xfd_tef_ring_update() with mcp251xfd_get_tef_len().
The mcp251xfd_handle_tefif() function reads the CAN transmit complete
events from the chip, iterates over them and pushes them into the
network stack. The original driver already contains code to detect old
CAN transmit complete events, that will be updated in the next patch.
Cc: Stefan Althöfer <Stefan.Althoefer@janztec.com>
Cc: Thomas Kopp <thomas.kopp@microchip.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/caif')
0 files changed, 0 insertions, 0 deletions