[PATCH 0/7] can: m_can: fix pm_runtime and CAN state handling

Marc Kleine-Budde posted 7 patches 1 month, 3 weeks ago
There is a newer version of this series
drivers/net/can/m_can/m_can.c          | 93 ++++++++++++++++++++++++----------
drivers/net/can/m_can/m_can.h          |  1 +
drivers/net/can/m_can/m_can_platform.c |  2 +-
3 files changed, 68 insertions(+), 28 deletions(-)
[PATCH 0/7] can: m_can: fix pm_runtime and CAN state handling
Posted by Marc Kleine-Budde 1 month, 3 weeks ago
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)

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Marc Kleine-Budde (7):
      can: m_can: m_can_plat_remove(): add missing pm_runtime_disable()
      can: m_can: m_can_rx_handler(): 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          | 93 ++++++++++++++++++++++++----------
 drivers/net/can/m_can/m_can.h          |  1 +
 drivers/net/can/m_can/m_can_platform.c |  2 +-
 3 files changed, 68 insertions(+), 28 deletions(-)
---
base-commit: 89886abd073489e26614e4d80fb8eb70d3938a0b
change-id: 20250811-m_can-fix-state-handling-0ba4bda6cb8e

Best regards,
--  
Marc Kleine-Budde <mkl@pengutronix.de>
Re: [PATCH 0/7] can: m_can: fix pm_runtime and CAN state handling
Posted by Philipp Zabel 1 month, 3 weeks ago
On Di, 2025-08-12 at 19:36 +0200, Marc Kleine-Budde wrote:
> 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)

Should this declare a dependency on
https://lore.kernel.org/all/20250807-stm32mp15-m_can-add-reset-v2-1-f69ebbfced1f@pengutronix.de/
or is that already merged?

regards
Philipp
Re: [PATCH 0/7] can: m_can: fix pm_runtime and CAN state handling
Posted by Marc Kleine-Budde 1 month, 3 weeks ago
On 13.08.2025 10:17:49, Philipp Zabel wrote:
> On Di, 2025-08-12 at 19:36 +0200, Marc Kleine-Budde wrote:
> > 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)
> 
> Should this declare a dependency on
> https://lore.kernel.org/all/20250807-stm32mp15-m_can-add-reset-v2-1-f69ebbfced1f@pengutronix.de/
> or is that already merged?

Still open, reference added to the cover letter.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |