]> git.ipfire.org Git - thirdparty/linux.git/commit
can: mcp251xfd: mcp251xfd_ring_init(): check TX-coalescing configuration
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 5 Jul 2024 15:24:42 +0000 (17:24 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 6 Aug 2024 07:52:13 +0000 (09:52 +0200)
commitac2b81eb8b2d104033560daea886ee84531e3d0a
tree455ab36e9ba8b096a95053504df2007cf65f891e
parent50ea5449c56310d2d31c28ba91a59232116d3c1e
can: mcp251xfd: mcp251xfd_ring_init(): check TX-coalescing configuration

When changing the interface from CAN-CC to CAN-FD mode the old
coalescing parameters are re-used. This might cause problem, as the
configured parameters are too big for CAN-FD mode.

During testing an invalid TX coalescing configuration has been seen.
The problem should be been fixed in the previous patch, but add a
safeguard here to ensure that the number of TEF coalescing buffers (if
configured) is exactly the half of all TEF buffers.

Link: https://lore.kernel.org/all/20240805-mcp251xfd-fix-ringconfig-v1-2-72086f0ca5ee@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c