]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: m_can: fix CAN state in system PM
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 12 Aug 2025 14:58:31 +0000 (16:58 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 8 Oct 2025 08:19:02 +0000 (10:19 +0200)
commita9e30a22d6f23a2684c248871cad4c3061181639
tree455a088f16c93d361cee60df264d17927f666801
parent4942c42fe1849e6d68dfb5b36ccba344a9fac016
can: m_can: fix CAN state in system PM

A suspend/resume cycle on a down interface results in the interface
coming up in Error Active state. A suspend/resume cycle on an Up
interface will always result in Error Active state, regardless of the
actual CAN state.

During suspend, only set running interfaces to CAN_STATE_SLEEPING.
During resume only touch the CAN state of running interfaces. For
wakeup sources, set the CAN state depending on the Protocol Status
Regitser (PSR), for non wakeup source interfaces m_can_start() will do
the same.

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