Merge patch series "can: mcp251xfd: workaround for erratum DS80000789E 6 of mcp2518fd"
Marc Kleine-Budde <mkl@pengutronix.de> says: This patch series tries to work around erratum DS80000789E 6 of the mcp2518fd, found by Stefan Althöfer, 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. In the original code, the driver always trusted the read value. For the RX FIDO this caused old, already processed CAN frames or new, incompletely written CAN frames to be (re-)processed. To work around this issue, keep a per FIFO timestamp of the last valid received CAN frame and compare against the timestamp of every received CAN frame. Further tests showed that this workaround can recognize old CAN frames, but a small time window remains in which partially written CAN frames are not recognized but then processed. These CAN frames have the correct data and time stamps, but the DLC has not yet been updated. For the TEF FIFO the original driver already detects the error, update the error handling with the knowledge that it is causes by this erratum. Link: https://lore.kernel.org/all/20240628-mcp251xfd-workaround-erratum-6-v4-0-53586f168524@pengutronix.deSigned-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Showing
Please register or sign in to comment