public inbox for linux-kernel@vger.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: Wed, 18 Feb 2026 11:51:15 +0100	[thread overview]
Message-ID: <DGI13PI02XEN.3MNAWATF73XVL@baylibre.com> (raw)
In-Reply-To: <20260213-mcan-out-of-band-v1-1-af68d4c570b3@ti.com>

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

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?

Best
Markus

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 289 bytes --]

  parent reply	other threads:[~2026-02-18 10:51 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 [this message]
2026-02-19 20:31   ` Kendall Willis
2026-02-26 16:39     ` Markus Schneider-Pargmann

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=DGI13PI02XEN.3MNAWATF73XVL@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox