]> www.infradead.org Git - linux.git/commit
can: rockchip_canfd: prepare to use full TX-FIFO depth
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 17 Jan 2024 17:56:35 +0000 (18:56 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 4 Sep 2024 12:41:53 +0000 (14:41 +0200)
commitae002cc32ec49d9845cf361a81cd4a7a91a0384e
tree808b8f3f73755890562a94df4313692a275238d3
parent669904d14609352b5c46b898b8560ffe46bcab78
can: rockchip_canfd: prepare to use full TX-FIFO depth

So far the TX-FIFO is only used with a depth of 1, although the
hardware offers a depth of 2.

The workaround for the chips that are affected by erratum 6, i.e. EFF
frames may be send as standard frames, is to re-send the EFF frame.
This means the driver cannot queue the next frame for sending, as long
ad the EFF frame has not been successfully send out.

Introduce rkcanfd_get_effective_tx_free() that returns "0" space in
the TX-FIFO if an EFF frame is pending and the actual free space in
the TX-FIFO otherwise. Then replace rkcanfd_get_tx_free() with
rkcanfd_get_effective_tx_free() everywhere.

Tested-by: Alibek Omarov <a1ba.omarov@gmail.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20240904-rockchip-canfd-v5-16-8ae22bcb27cc@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/rockchip/rockchip_canfd-rx.c
drivers/net/can/rockchip/rockchip_canfd-tx.c
drivers/net/can/rockchip/rockchip_canfd.h