can: m_can: Implement transmit coalescing
authorMarkus Schneider-Pargmann <msp@baylibre.com>
Wed, 7 Feb 2024 09:32:11 +0000 (10:32 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 12 Feb 2024 16:02:43 +0000 (17:02 +0100)
commitec390d0876170c075fb5ada568db1e03dd790b5b
treef8e715349fe784200def4989be8b8b2a2777fe6d
parent07f25091ca0265da65ea7a4bd2409c627f529c6f
can: m_can: Implement transmit coalescing

Extend the coalescing implementation for transmits.

In normal mode the chip raises an interrupt for every finished transmit.
This implementation switches to coalescing mode as soon as an interrupt
handled a transmit. For coalescing the watermark level interrupt is used
to interrupt exactly after x frames were sent. It switches back into
normal mode once there was an interrupt with no finished transmit and
the timer being inactive.

The timer is shared with receive coalescing. The time for receive and
transmit coalescing timers have to be the same for that to work. The
benefit is to have only a single running timer.

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/all/20240207093220.2681425-6-msp@baylibre.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/m_can.c
drivers/net/can/m_can/m_can.h