linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] can: m_can: fix pm_runtime and CAN state handling
@ 2025-09-09 17:53 Marc Kleine-Budde
  2025-09-09 17:53 ` [PATCH v2 1/7] can: m_can: m_can_plat_remove(): add missing pm_runtime_disable() Marc Kleine-Budde
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Marc Kleine-Budde @ 2025-09-09 17:53 UTC (permalink / raw)
  To: Chandrasekar Ramakrishnan, Vincent Mailhol, Patrik Flykt,
	Dong Aisheng, Varka Bhadram, Wu Bo, Markus Schneider-Pargmann,
	Philipp Zabel
  Cc: linux-can, linux-kernel, kernel, Marc Kleine-Budde

The first patch fixes a pm_runtime imbalance in the m_can_platform
driver.

The rest of this series fixes the CAN state handling in the m_can
driver:
- add the missing state transition from from Error Warning back to
  Error Active (Patches 2+3)
- address the fact that in some SoCs (observed on the STM32MP15) the
  M_CAN IP core keeps the CAN state and CAN error counters over an
  internal reset cycle. Set the correct CAN state during ifup and
  system resume (Patches 4+5)
- add support for optional shared external reset, to properly reset
  the IP core (Patches 6+7)

The update of the DT binding for the reset property is upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git/commit/?h=stm32-next&id=cfd856da6cf561f7e1dc6b16f3453814cde1058e

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes in v2:
- cover: added link to DT bindings update (thanks Philipp)
- 1: add Markus's R-b
- 2: always mask active interrupts (thanks Markus)
- 3: remove not needed comments (thanks Markus)
- 3: rename m_can_can_state_get_by_psr() -> m_can_state_get_by_psr() (thanks Markus)
- 3: read PSR inside m_can_state_get_by_psr() (thanks Markus)
- 5: add Markus's R-b
- 7: fix typo (thanks Philipp)
- 7: rename struct m_can_classdev::rsts -> rst (thanks Philipp)
- Link to v1: https://patch.msgid.link/20250812-m_can-fix-state-handling-v1-0-b739e06c0a3b@pengutronix.de

---
Marc Kleine-Budde (7):
      can: m_can: m_can_plat_remove(): add missing pm_runtime_disable()
      can: m_can: only handle active interrupts
      can: m_can: m_can_handle_state_errors(): fix CAN state transition to Error Active
      can: m_can: m_can_chip_config(): bring up interface in correct state
      can: m_can: fix CAN state in system PM
      can: m_can: m_can_get_berr_counter(): don't wake up controller if interface is down
      can: m_can: add optional support for reset

 drivers/net/can/m_can/m_can.c          | 97 +++++++++++++++++++++++-----------
 drivers/net/can/m_can/m_can.h          |  1 +
 drivers/net/can/m_can/m_can_platform.c |  2 +-
 3 files changed, 69 insertions(+), 31 deletions(-)
---
base-commit: d3b28612bc5500133260aaf36794a0a0c287d61b
change-id: 20250811-m_can-fix-state-handling-0ba4bda6cb8e

Best regards,
--  
Marc Kleine-Budde <mkl@pengutronix.de>



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-09-10 16:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-09 17:53 [PATCH v2 0/7] can: m_can: fix pm_runtime and CAN state handling Marc Kleine-Budde
2025-09-09 17:53 ` [PATCH v2 1/7] can: m_can: m_can_plat_remove(): add missing pm_runtime_disable() Marc Kleine-Budde
2025-09-09 17:53 ` [PATCH v2 2/7] can: m_can: only handle active interrupts Marc Kleine-Budde
2025-09-10  8:41   ` Markus Schneider-Pargmann
2025-09-10 14:28     ` Marc Kleine-Budde
2025-09-10 15:06       ` Marc Kleine-Budde
2025-09-10 16:04         ` Markus Schneider-Pargmann
2025-09-09 17:53 ` [PATCH v2 3/7] can: m_can: m_can_handle_state_errors(): fix CAN state transition to Error Active Marc Kleine-Budde
2025-09-10  8:47   ` Markus Schneider-Pargmann
2025-09-09 17:53 ` [PATCH v2 4/7] can: m_can: m_can_chip_config(): bring up interface in correct state Marc Kleine-Budde
2025-09-10  8:57   ` Markus Schneider-Pargmann
2025-09-09 17:53 ` [PATCH v2 5/7] can: m_can: fix CAN state in system PM Marc Kleine-Budde
2025-09-09 17:53 ` [PATCH v2 6/7] can: m_can: m_can_get_berr_counter(): don't wake up controller if interface is down Marc Kleine-Budde
2025-09-09 17:53 ` [PATCH v2 7/7] can: m_can: add optional support for reset Marc Kleine-Budde
2025-09-10  9:32   ` Markus Schneider-Pargmann
2025-09-10 14:35     ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).