]> Gentwo Git Trees - linux/.git/commit
can: m_can: Do not cancel timer from within timer
authorMarkus Schneider-Pargmann <msp@baylibre.com>
Mon, 5 Aug 2024 18:30:44 +0000 (20:30 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 6 Aug 2024 07:25:30 +0000 (09:25 +0200)
commit4d5159bfafa8d1a205d8213b7434e0402588b9ed
treed1793e5aa6134f9c7d1d3221e5ed5d80c9489ff4
parent40e4552eeef0e3090a5988de15889795936fd38f
can: m_can: Do not cancel timer from within timer

On setups without interrupts, the interrupt handler is called from a
timer callback. For non-peripheral receives napi is scheduled,
interrupts are disabled and the timer is canceled with a blocking call.
In case of an error this can happen as well.

Check if napi is scheduled in the timer callback after the interrupt
handler executed. If napi is scheduled, the timer is disabled. It will
be reenabled by m_can_poll().

Return error values from the interrupt handler so that interrupt threads
and timer callback can deal differently with it. In case of the timer
we only disable the timer. The rest will be done when stopping the
interface.

Fixes: b382380c0d2d ("can: m_can: Add hrtimer to generate software interrupt")
Fixes: a163c5761019 ("can: m_can: Start/Cancel polling timer together with interrupts")
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Link: https://lore.kernel.org/all/20240805183047.305630-5-msp@baylibre.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/m_can.c