linux/drivers/net/can/spi
Marc Kleine-Budde 3a0a88fcba can: mcp251xfd: tef: update workaround for erratum DS80000789E 6 of mcp2518fd
This patch updates the workaround for 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.

In the bad case, the driver reads a too large head index. As the FIFO
is implemented as a ring buffer, this results in re-handling old CAN
transmit complete events.

Every transmit complete event contains with a sequence number that
equals to the sequence number of the corresponding TX request. This
way old TX complete events can be detected.

If the original driver detects a non matching sequence number, it
prints an info message and tries again later. As wrong sequence
numbers can be explained by the erratum DS80000789E 6, demote the info
message to debug level, streamline the code and update the comments.

Keep the behavior: If an old CAN TX complete event is detected, abort
the iteration and mark the number of valid CAN TX complete events as
processed in the chip by incrementing the FIFO's tail index.

Cc: Stefan Althöfer <Stefan.Althoefer@janztec.com>
Cc: Thomas Kopp <thomas.kopp@microchip.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2024-06-28 23:48:12 +02:00
..
mcp251xfd can: mcp251xfd: tef: update workaround for erratum DS80000789E 6 of mcp2518fd 2024-06-28 23:48:12 +02:00
hi311x.c can: hi311x: simplify with spi_get_device_match_data() 2024-06-21 09:46:38 +02:00
Kconfig can: mcp251xfd: rename driver files and subdir to mcp251xfd 2020-09-30 21:54:30 +02:00
Makefile can: mcp251xfd: rename driver files and subdir to mcp251xfd 2020-09-30 21:54:30 +02:00
mcp251x.c can: mcp251x: simplify with spi_get_device_match_data() 2024-06-21 09:46:39 +02:00