* [PATCH] can: m_can: set out-of-band wakeup if wakeup pinctrl exists @ 2026-02-13 18:08 Kendall Willis 2026-02-17 21:08 ` Marc Kleine-Budde 2026-02-18 10:51 ` Markus Schneider-Pargmann 0 siblings, 2 replies; 6+ messages in thread From: Kendall Willis @ 2026-02-13 18:08 UTC (permalink / raw) To: Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol Cc: sebin.francis, d-gole, vishalm, linux-can, linux-kernel, Kendall Willis 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. 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); + else pinctrl_pm_select_sleep_state(dev); return ret; --- base-commit: af98e93c5c39e6d0b87b42f0a32dd3066f795718 change-id: 20260213-mcan-out-of-band-bae2065f0bf5 Best regards, -- Kendall Willis <k-willis@ti.com> ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] can: m_can: set out-of-band wakeup if wakeup pinctrl exists 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 1 sibling, 1 reply; 6+ messages in thread From: Marc Kleine-Budde @ 2026-02-17 21:08 UTC (permalink / raw) To: Kendall Willis Cc: Markus Schneider-Pargmann, Vincent Mailhol, sebin.francis, d-gole, vishalm, linux-can, linux-kernel [-- Attachment #1: Type: text/plain, Size: 862 bytes --] On 13.02.2026 12:08:19, 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. > > Signed-off-by: Kendall Willis <k-willis@ti.com> @Markus, can you review the patch? To both of you: Do we need a fixes tag? regards, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] can: m_can: set out-of-band wakeup if wakeup pinctrl exists 2026-02-17 21:08 ` Marc Kleine-Budde @ 2026-02-18 10:57 ` Markus Schneider-Pargmann 0 siblings, 0 replies; 6+ messages in thread From: Markus Schneider-Pargmann @ 2026-02-18 10:57 UTC (permalink / raw) To: Marc Kleine-Budde, Kendall Willis Cc: Markus Schneider-Pargmann, Vincent Mailhol, sebin.francis, d-gole, vishalm, linux-can, linux-kernel [-- Attachment #1: Type: text/plain, Size: 923 bytes --] Hi Marc, On Tue Feb 17, 2026 at 10:08 PM CET, Marc Kleine-Budde wrote: > On 13.02.2026 12:08:19, 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. >> >> Signed-off-by: Kendall Willis <k-willis@ti.com> > > @Markus, can you review the patch? > > To both of you: Do we need a fixes tag? I don't think so. device_out_band_wakeup() was introduced after the wakeup pinctrl was added to this driver. So I don't think this qualifies as a fix. 4acbfb6c116b ("PM: wakeup: Add out-of-band system wakeup support for devices") Best Markus [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 289 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] can: m_can: set out-of-band wakeup if wakeup pinctrl exists 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:51 ` Markus Schneider-Pargmann 2026-02-19 20:31 ` Kendall Willis 1 sibling, 1 reply; 6+ messages in thread From: Markus Schneider-Pargmann @ 2026-02-18 10:51 UTC (permalink / raw) To: Kendall Willis, Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol Cc: sebin.francis, d-gole, vishalm, linux-can, linux-kernel [-- 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 --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] can: m_can: set out-of-band wakeup if wakeup pinctrl exists 2026-02-18 10:51 ` Markus Schneider-Pargmann @ 2026-02-19 20:31 ` Kendall Willis 2026-02-26 16:39 ` Markus Schneider-Pargmann 0 siblings, 1 reply; 6+ messages in thread From: Kendall Willis @ 2026-02-19 20:31 UTC (permalink / raw) To: Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol Cc: sebin.francis, d-gole, vishalm, linux-can, linux-kernel 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. I am good with implementing the idea you suggested, but those were some considerations that I was unsure about for the implementation. Let me know what you think, and thanks for reviewing! Best, Kendall > > Best > Markus ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] can: m_can: set out-of-band wakeup if wakeup pinctrl exists 2026-02-19 20:31 ` Kendall Willis @ 2026-02-26 16:39 ` Markus Schneider-Pargmann 0 siblings, 0 replies; 6+ messages in thread From: Markus Schneider-Pargmann @ 2026-02-26 16:39 UTC (permalink / raw) To: Kendall Willis, Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol Cc: sebin.francis, d-gole, vishalm, linux-can, linux-kernel [-- 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 --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-02-26 16:39 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox