Re: [PATCH] can: m_can: set out-of-band wakeup if wakeup pinctrl exists

From: Markus Schneider-Pargmann

Date: Wed Feb 18 2026 - 05:51:42 EST


Hi Kendall,

On Fri Feb 13, 2026 at 7:08 PM CET, Kendall Willis wrote:
> In TI AM62X, AM62A, and AM62P SoCs, the m_can pins can act as a wakeup
> source in the deepest low power states. However, the m_can pins are a part
> of the MCU domain which is OFF in deeper low power states. Since the m_can
> pins continue to be ON even if the MCU domain is turned off, set
> out-of-band wakeup for CAN device if `wakeup` pinctrl state exists and
> device may wakeup.

Thank you for your patch.

>
> Signed-off-by: Kendall Willis <k-willis@xxxxxx>
> ---
> Tested on CAN IO wakeup from DeepSleep low power mode on AM62P EVM.
> ---
> drivers/net/can/m_can/m_can.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index eb856547ae7df27a844b236a0c1d4498cbb8b60f..8b277f5e208ffa634439b9ea8495ed56f12cfccb 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -2622,7 +2622,9 @@ int m_can_class_suspend(struct device *dev)
> cdev->can.state = CAN_STATE_SLEEPING;
> }
>
> - if (!m_can_class_wakeup_pinctrl_enabled(cdev))
> + if (m_can_class_wakeup_pinctrl_enabled(cdev))
> + device_set_out_band_wakeup(dev);

This will set out of band wakeup for every m_can that has a
wakeup-pinctrl set. am62* is currently probably the only platform that
uses the wakeup pinctrl setting but that may change at some point in the
future. Can we narrow down setting the out of band wakeup to the
platforms that support it?

One idea could be to parse the supported system-idle-states from the
list of wakeup-sources and see if deep states are supported that would
require m_can to be off, e.g. mem-deep, off-wake. I think that would be
a clear indicator that out of band wakeups are supported.

For the list of state names you can have a look in the dtschema
repository:
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/system-idle-states.yaml

What do you think?

Best
Markus

Attachment: signature.asc
Description: PGP signature