All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Markus Schneider-Pargmann" <msp@baylibre.com>
To: "Kendall Willis" <k-willis@ti.com>,
	"Markus Schneider-Pargmann" <msp@baylibre.com>,
	"Marc Kleine-Budde" <mkl@pengutronix.de>,
	"Vincent Mailhol" <mailhol@kernel.org>
Cc: <sebin.francis@ti.com>, <d-gole@ti.com>, <vishalm@ti.com>,
	<linux-can@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] can: m_can: set out-of-band wakeup if wakeup pinctrl exists
Date: Thu, 26 Feb 2026 17:39:10 +0100	[thread overview]
Message-ID: <DGP1IG1JH4NE.17BPCN6IDT2OR@baylibre.com> (raw)
In-Reply-To: <b330487e-0564-47b8-95a3-c6c207964056@ti.com>

[-- Attachment #1: Type: text/plain, Size: 3421 bytes --]

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@ti.com>
>>> ---
>>> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 289 bytes --]

      reply	other threads:[~2026-02-26 16:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-13 18:08 [PATCH] can: m_can: set out-of-band wakeup if wakeup pinctrl exists Kendall Willis
2026-02-17 21:08 ` Marc Kleine-Budde
2026-02-18 10:57   ` Markus Schneider-Pargmann
2026-02-18 10:51 ` Markus Schneider-Pargmann
2026-02-19 20:31   ` Kendall Willis
2026-02-26 16:39     ` Markus Schneider-Pargmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DGP1IG1JH4NE.17BPCN6IDT2OR@baylibre.com \
    --to=msp@baylibre.com \
    --cc=d-gole@ti.com \
    --cc=k-willis@ti.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=sebin.francis@ti.com \
    --cc=vishalm@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.