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: b382380c ("can: m_can: Add hrtimer to generate software interrupt") Fixes: a163c576 ("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.comSigned-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
Showing
Please register or sign in to comment