The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v3 0/2] can: m_can: support out-of-band wakeup capability
@ 2026-08-21 16:06 Kendall Willis
  2026-08-21 16:07 ` [PATCH v3 1/2] dt-bindings: can: m_can: add out-band-wakeup property Kendall Willis
  2026-08-21 16:07 ` [PATCH v3 2/2] can: m_can: set out-of-band wakeup if wakeup pinctrl exists Kendall Willis
  0 siblings, 2 replies; 6+ messages in thread
From: Kendall Willis @ 2026-08-21 16:06 UTC (permalink / raw)
  To: Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Chandrasekar Ramakrishnan
  Cc: s-kochidanadu, a-kaur, s-tripathi1, vishalm, k-willis, linux-can,
	devicetree, linux-kernel

This series adds support for the out-of-band wakeup capability in the m_can
driver. Some CAN devices are wakeup capable and can wake up the system
while being in a domain that is OFF. Allow the driver to set the
out-of-band wakeup flag during suspend if the "out-band-wakeup" property
is present in the device tree.

A corresponding DTS series enabling this feature on TI K3 AM62A, AM62D,
AM62P, and AM62X-LP SoCs has been submitted separately:
"arm64: dts: ti: add out-band-wakeup property to m_can devices"

Dependency
----------
The DT bindings are dependent on this PR in the dt-schema repository,
which defines the out-band-wakeup property:
https://github.com/devicetree-org/dt-schema/pull/205

Testing
-------
Tested suspend/resume with CAN wakeup on AM62P SK EVM.

Signed-off-by: Kendall Willis <k-willis@ti.com>
---
Changes in v3:
- Remove definition of "out-band-wakeup" property in dt binding.
- Allow "out-band-wakeup" property in dt binding.
- Link to v2: https://lore.kernel.org/r/20260820-temp-v2-0-dd3f8cacc15e@ti.com

Changes in v2:
- Create "out-band-wakeup" property in dt bindings.
- Use "out-band-wakeup" property to set the out_band_wakeup flag upon
  suspend.
- Rebase to v7.2
- Link to v1: https://lore.kernel.org/r/20260213-mcan-out-of-band-v1-1-af68d4c570b3@ti.com

---
Kendall Willis (2):
      dt-bindings: can: m_can: add out-band-wakeup property
      can: m_can: set out-of-band wakeup if wakeup pinctrl exists

 Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 2 ++
 drivers/net/can/m_can/m_can.c                              | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
---
base-commit: 8d3ae59288f1e7d58d76558a6ee96d533bc5019f
change-id: 20260819-temp-93299bee27b7

Best regards,
-- 
Kendall Willis <k-willis@ti.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/2] dt-bindings: can: m_can: add out-band-wakeup property
  2026-08-21 16:06 [PATCH v3 0/2] can: m_can: support out-of-band wakeup capability Kendall Willis
@ 2026-08-21 16:07 ` Kendall Willis
  2026-08-21 16:45   ` Conor Dooley
  2026-08-21 16:07 ` [PATCH v3 2/2] can: m_can: set out-of-band wakeup if wakeup pinctrl exists Kendall Willis
  1 sibling, 1 reply; 6+ messages in thread
From: Kendall Willis @ 2026-08-21 16:07 UTC (permalink / raw)
  To: Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Chandrasekar Ramakrishnan
  Cc: s-kochidanadu, a-kaur, s-tripathi1, vishalm, k-willis, linux-can,
	devicetree, linux-kernel

Add the out-band-wakeup property as a possible property. The property
indicates that the device can wakeup the system even when its power
domain is off.

Signed-off-by: Kendall Willis <k-willis@ti.com>
---
 Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
index 2c9d37975bedd652b3060ab11ba75c37565edaad..0663beaa532bcc4a71cd6ad01520a4dfea294d0c 100644
--- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
+++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
@@ -150,6 +150,8 @@ properties:
     description:
       List of phandles to system idle states in which mcan can wakeup the system.
 
+  out-band-wakeup: true
+
 required:
   - compatible
   - reg

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 2/2] can: m_can: set out-of-band wakeup if wakeup pinctrl exists
  2026-08-21 16:06 [PATCH v3 0/2] can: m_can: support out-of-band wakeup capability Kendall Willis
  2026-08-21 16:07 ` [PATCH v3 1/2] dt-bindings: can: m_can: add out-band-wakeup property Kendall Willis
@ 2026-08-21 16:07 ` Kendall Willis
  1 sibling, 0 replies; 6+ messages in thread
From: Kendall Willis @ 2026-08-21 16:07 UTC (permalink / raw)
  To: Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Chandrasekar Ramakrishnan
  Cc: s-kochidanadu, a-kaur, s-tripathi1, vishalm, k-willis, linux-can,
	devicetree, linux-kernel

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 the
out-of-band wakeup flag if the CAN device may wakeup, has the
"out-band-wakeup" property in the device tree node, and has the "wakeup"
pinctrl state.

Signed-off-by: Kendall Willis <k-willis@ti.com>
---
 drivers/net/can/m_can/m_can.c | 6 +++++-
 1 file changed, 5 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..e745660fb3eb311de70635fcfc016a44e62d5602 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -2622,8 +2622,12 @@ 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)) {
+		if (device_property_read_bool(dev, "out-band-wakeup"))
+			device_set_out_band_wakeup(dev);
+	} else {
 		pinctrl_pm_select_sleep_state(dev);
+	}
 
 	return ret;
 }

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: can: m_can: add out-band-wakeup property
  2026-08-21 16:07 ` [PATCH v3 1/2] dt-bindings: can: m_can: add out-band-wakeup property Kendall Willis
@ 2026-08-21 16:45   ` Conor Dooley
  2026-08-21 19:05     ` Kendall Willis
  0 siblings, 1 reply; 6+ messages in thread
From: Conor Dooley @ 2026-08-21 16:45 UTC (permalink / raw)
  To: Kendall Willis
  Cc: Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Chandrasekar Ramakrishnan, s-kochidanadu, a-kaur, s-tripathi1,
	vishalm, linux-can, devicetree, linux-kernel

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

On Fri, Aug 21, 2026 at 11:07:00AM -0500, Kendall Willis wrote:
> Add the out-band-wakeup property as a possible property. The property
> indicates that the device can wakeup the system even when its power
> domain is off.
> 
> Signed-off-by: Kendall Willis <k-willis@ti.com>
> ---
>  Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
> index 2c9d37975bedd652b3060ab11ba75c37565edaad..0663beaa532bcc4a71cd6ad01520a4dfea294d0c 100644
> --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
> +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
> @@ -150,6 +150,8 @@ properties:
>      description:
>        List of phandles to system idle states in which mcan can wakeup the system.
>  
> +  out-band-wakeup: true

Where is "-wakeup" defined genericly, or out-band-wakeup defined that
you're getting the property definition from?

> +
>  required:
>    - compatible
>    - reg
> 
> -- 
> 2.34.1
> 

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: can: m_can: add out-band-wakeup property
  2026-08-21 16:45   ` Conor Dooley
@ 2026-08-21 19:05     ` Kendall Willis
  2026-08-24 16:50       ` Conor Dooley
  0 siblings, 1 reply; 6+ messages in thread
From: Kendall Willis @ 2026-08-21 19:05 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Chandrasekar Ramakrishnan, s-kochidanadu, a-kaur, s-tripathi1,
	vishalm, linux-can, devicetree, linux-kernel

On 17:45-20260821, Conor Dooley wrote:
> On Fri, Aug 21, 2026 at 11:07:00AM -0500, Kendall Willis wrote:
> > Add the out-band-wakeup property as a possible property. The property
> > indicates that the device can wakeup the system even when its power
> > domain is off.
> > 
> > Signed-off-by: Kendall Willis <k-willis@ti.com>
> > ---
> >  Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
> > index 2c9d37975bedd652b3060ab11ba75c37565edaad..0663beaa532bcc4a71cd6ad01520a4dfea294d0c 100644
> > --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
> > +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
> > @@ -150,6 +150,8 @@ properties:
> >      description:
> >        List of phandles to system idle states in which mcan can wakeup the system.
> >  
> > +  out-band-wakeup: true
> 
> Where is "-wakeup" defined genericly, or out-band-wakeup defined that
> you're getting the property definition from?

I sent a PR to define out-band-wakeup in the wakeup-source.yaml binding
in dt-schema repo. I figured it made more sense to be defined in the
wakeup-source.yaml binding to allow other drivers the option to use it.

dt-schema PR:
https://github.com/devicetree-org/dt-schema/pull/205

> 
> > +
> >  required:
> >    - compatible
> >    - reg
> > 
> > -- 
> > 2.34.1
> > 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: can: m_can: add out-band-wakeup property
  2026-08-21 19:05     ` Kendall Willis
@ 2026-08-24 16:50       ` Conor Dooley
  0 siblings, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2026-08-24 16:50 UTC (permalink / raw)
  To: Kendall Willis
  Cc: Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Chandrasekar Ramakrishnan, s-kochidanadu, a-kaur, s-tripathi1,
	vishalm, linux-can, devicetree, linux-kernel

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

On Fri, Aug 21, 2026 at 02:05:11PM -0500, Kendall Willis wrote:
> On 17:45-20260821, Conor Dooley wrote:
> > On Fri, Aug 21, 2026 at 11:07:00AM -0500, Kendall Willis wrote:
> > > Add the out-band-wakeup property as a possible property. The property
> > > indicates that the device can wakeup the system even when its power
> > > domain is off.
> > > 
> > > Signed-off-by: Kendall Willis <k-willis@ti.com>
> > > ---
> > >  Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
> > > index 2c9d37975bedd652b3060ab11ba75c37565edaad..0663beaa532bcc4a71cd6ad01520a4dfea294d0c 100644
> > > --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
> > > +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
> > > @@ -150,6 +150,8 @@ properties:
> > >      description:
> > >        List of phandles to system idle states in which mcan can wakeup the system.
> > >  
> > > +  out-band-wakeup: true
> > 
> > Where is "-wakeup" defined genericly, or out-band-wakeup defined that
> > you're getting the property definition from?
> 
> I sent a PR to define out-band-wakeup in the wakeup-source.yaml binding
> in dt-schema repo. I figured it made more sense to be defined in the
> wakeup-source.yaml binding to allow other drivers the option to use it.
> 
> dt-schema PR:
> https://github.com/devicetree-org/dt-schema/pull/205

This sounds like something you should be able to determine from
device specific compatibles for these platforms. Not sure why they are
not used for this particular device, but this is an indication to me
that that is a mistake.

Cheers,
Conor.

> 
> > 
> > > +
> > >  required:
> > >    - compatible
> > >    - reg
> > > 
> > > -- 
> > > 2.34.1
> > > 

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-24 16:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 16:06 [PATCH v3 0/2] can: m_can: support out-of-band wakeup capability Kendall Willis
2026-08-21 16:07 ` [PATCH v3 1/2] dt-bindings: can: m_can: add out-band-wakeup property Kendall Willis
2026-08-21 16:45   ` Conor Dooley
2026-08-21 19:05     ` Kendall Willis
2026-08-24 16:50       ` Conor Dooley
2026-08-21 16:07 ` [PATCH v3 2/2] can: m_can: set out-of-band wakeup if wakeup pinctrl exists Kendall Willis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox