Re: [PATCH] can: m_can: set out-of-band wakeup if wakeup pinctrl exists
From: Markus Schneider-Pargmann
Date: Thu Feb 26 2026 - 12:49:48 EST
Hi Kendall,
On Thu Feb 19, 2026 at 9:31 PM CET, Kendall Willis wrote:
> Hi Markus,
> On 2/18/26 04:51, Markus Schneider-Pargmann wrote:
>> 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?
>
> I agree that we should narrow down setting the out of band wakeup to the
> platform, but I am unsure of parsing the supported system-idle-states as
> the solution. Since we don't know how the power domains in other
> platforms are organized, it would be hard to say that if deeper idle
> states are supported mcan has out of band wakeup logic. It could be the
> whole power domain was designed for the deeper power states.
>
> Additionally, without out of band wakeup for mcan on AM62 devices, mcan
> can only wakeup from mem-mcu-active idle state, and adding out of band
> wakeup allows for wakeup from mem idle state and deeper. Checking for
> mem idle state doesn't seem deep enough to warrant setting out of band
> wakeup for all platforms since some platforms could have mcan in a power
> domain that is ON during the mem idle state.
>
> Another idea would be to add some sort of property to the device tree to
> denote the wakeup source is an out of band wakeup source.
Sure, a generic DT property would be good as well. Do you already have
something in mind?
Best
Markus
Attachment:
signature.asc
Description: PGP signature