]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
can: m_can: m_can_handle_state_errors(): fix CAN state transition to Error Active
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 6 Aug 2025 14:56:15 +0000 (16:56 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 8 Oct 2025 08:18:51 +0000 (10:18 +0200)
commit3d9db29b45f970d81acf61cf91a65442efbeb997
tree1d041afe0f45ba30095a1be8e26195f83552aff3
parentba569fb07a7e9e9b71e9282e27e993ba859295c2
can: m_can: m_can_handle_state_errors(): fix CAN state transition to Error Active

The CAN Error State is determined by the receive and transmit error
counters. The CAN error counters decrease when reception/transmission
is successful, so that a status transition back to the Error Active
status is possible. This transition is not handled by
m_can_handle_state_errors().

Add the missing detection of the Error Active state to
m_can_handle_state_errors() and extend the handling of this state in
m_can_handle_state_change().

Fixes: e0d1f4816f2a ("can: m_can: add Bosch M_CAN controller support")
Fixes: cd0d83eab2e0 ("can: m_can: m_can_handle_state_change(): fix state change")
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Link: https://patch.msgid.link/20250929-m_can-fix-state-handling-v4-2-682b49b49d9a@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/m_can.c