* [PATCH v4 0/2] can: m_can: introduce ti,am62-m_can compatible for out-of-band wakeup
@ 2026-09-02 21:03 Kendall Willis
2026-09-02 21:03 ` [PATCH v4 1/2] dt-bindings: can: m_can: add ti,am62-m_can compatible Kendall Willis
2026-09-02 21:03 ` [PATCH v4 2/2] can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support Kendall Willis
0 siblings, 2 replies; 11+ messages in thread
From: Kendall Willis @ 2026-09-02 21:03 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 introduces the "ti,am62-m_can" compatible which adds support
for out-of-band wakeup capability in m_can devices.
A corresponding DTS series enabling this feature on TI K3 AM62 family
of devices has been submitted separately:
"arm64: dts: ti: use ti,am62-m_can compatible for m_can devices"
Testing
-------
Tested suspend/resume with CAN wakeup on AM62P SK EVM.
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
Changes in v4:
- Remove patch for "out-band-wakeup" property in dt binding.
- Create "ti,am62-m_can" compatible in the dt binding and m_can driver.
- Add "struct m_can_pdata" for compatible-specific data which keeps track
of "out_band_wakeup" flag.
- Replace check "out-band-wakeup" dt property in the device driver upon
suspend with check for "out_band_wakeup" variable from the
"m_can_pdata".
- Link to v3: https://lore.kernel.org/r/20260821-temp-v3-0-9ac1f8806929@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 ti,am62-m_can compatible
can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support
Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 4 +++-
drivers/net/can/m_can/m_can.c | 7 ++++++-
drivers/net/can/m_can/m_can.h | 4 ++++
drivers/net/can/m_can/m_can_platform.c | 5 +++++
4 files changed, 18 insertions(+), 2 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260819-temp-93299bee27b7
Best regards,
--
Kendall Willis <k-willis@ti.com>
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v4 1/2] dt-bindings: can: m_can: add ti,am62-m_can compatible 2026-09-02 21:03 [PATCH v4 0/2] can: m_can: introduce ti,am62-m_can compatible for out-of-band wakeup Kendall Willis @ 2026-09-02 21:03 ` Kendall Willis 2026-09-03 8:28 ` Markus Schneider-Pargmann 2026-09-03 13:45 ` Krzysztof Kozlowski 2026-09-02 21:03 ` [PATCH v4 2/2] can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support Kendall Willis 1 sibling, 2 replies; 11+ messages in thread From: Kendall Willis @ 2026-09-02 21:03 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 "ti,am62-m_can" to the list of compatible strings for the M_CAN controller binding. This compatible identifies TI AM62 SoCs which support out-of-band wakeup capability. Signed-off-by: Kendall Willis <k-willis@ti.com> --- Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml index 2c9d37975bedd652b3060ab11ba75c37565edaad..89e5a44453372c57506e9cf3a009b55a70cc4446 100644 --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml @@ -16,7 +16,9 @@ allOf: properties: compatible: - const: bosch,m_can + enum: + - bosch,m_can + - ti,am62-m_can reg: items: -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: can: m_can: add ti,am62-m_can compatible 2026-09-02 21:03 ` [PATCH v4 1/2] dt-bindings: can: m_can: add ti,am62-m_can compatible Kendall Willis @ 2026-09-03 8:28 ` Markus Schneider-Pargmann 2026-09-03 19:04 ` Kendall Willis 2026-09-03 13:45 ` Krzysztof Kozlowski 1 sibling, 1 reply; 11+ messages in thread From: Markus Schneider-Pargmann @ 2026-09-03 8:28 UTC (permalink / raw) To: Kendall Willis, Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chandrasekar Ramakrishnan Cc: s-kochidanadu, a-kaur, s-tripathi1, vishalm, linux-can, devicetree, linux-kernel [-- Attachment #1: Type: text/plain, Size: 1096 bytes --] Hi Kendall, On Wed Sep 2, 2026 at 11:03 PM CEST, Kendall Willis wrote: > Add "ti,am62-m_can" to the list of compatible strings for the M_CAN > controller binding. This compatible identifies TI AM62 SoCs which > support out-of-band wakeup capability. > > Signed-off-by: Kendall Willis <k-willis@ti.com> > --- > Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > index 2c9d37975bedd652b3060ab11ba75c37565edaad..89e5a44453372c57506e9cf3a009b55a70cc4446 100644 > --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > @@ -16,7 +16,9 @@ allOf: > > properties: > compatible: > - const: bosch,m_can > + enum: > + - bosch,m_can > + - ti,am62-m_can I think you should use oneOf here to allow the use of compatible = "ti,am62-m_can", "bosch,m_can"; Best Markus [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 289 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: can: m_can: add ti,am62-m_can compatible 2026-09-03 8:28 ` Markus Schneider-Pargmann @ 2026-09-03 19:04 ` Kendall Willis 0 siblings, 0 replies; 11+ messages in thread From: Kendall Willis @ 2026-09-03 19:04 UTC (permalink / raw) To: Markus Schneider-Pargmann Cc: 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 Hi Markus, On 10:28-20260903, Markus Schneider-Pargmann wrote: > Hi Kendall, > > On Wed Sep 2, 2026 at 11:03 PM CEST, Kendall Willis wrote: > > Add "ti,am62-m_can" to the list of compatible strings for the M_CAN > > controller binding. This compatible identifies TI AM62 SoCs which > > support out-of-band wakeup capability. > > > > Signed-off-by: Kendall Willis <k-willis@ti.com> > > --- > > Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > > index 2c9d37975bedd652b3060ab11ba75c37565edaad..89e5a44453372c57506e9cf3a009b55a70cc4446 100644 > > --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > > +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > > @@ -16,7 +16,9 @@ allOf: > > > > properties: > > compatible: > > - const: bosch,m_can > > + enum: > > + - bosch,m_can > > + - ti,am62-m_can > > I think you should use oneOf here to allow the use of > > compatible = "ti,am62-m_can", "bosch,m_can"; > Oops, yes this was a mistake on my part. Will fix in the next version. Best, Kendall ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: can: m_can: add ti,am62-m_can compatible 2026-09-02 21:03 ` [PATCH v4 1/2] dt-bindings: can: m_can: add ti,am62-m_can compatible Kendall Willis 2026-09-03 8:28 ` Markus Schneider-Pargmann @ 2026-09-03 13:45 ` Krzysztof Kozlowski 2026-09-03 20:00 ` Kendall Willis 1 sibling, 1 reply; 11+ messages in thread From: Krzysztof Kozlowski @ 2026-09-03 13: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 On Wed, Sep 02, 2026 at 04:03:27PM -0500, Kendall Willis wrote: > Add "ti,am62-m_can" to the list of compatible strings for the M_CAN Compatibles do not have underscores. Poor existing examples are not the example to follow. Also, no need to repeat the diff - we see that from the diff. Just say "Add foo bar, a baz-baz device, fully compatible or not compatible with Bosch because of this and that". > controller binding. This compatible identifies TI AM62 SoCs which > support out-of-band wakeup capability. > Best regards, Krzysztof ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: can: m_can: add ti,am62-m_can compatible 2026-09-03 13:45 ` Krzysztof Kozlowski @ 2026-09-03 20:00 ` Kendall Willis 0 siblings, 0 replies; 11+ messages in thread From: Kendall Willis @ 2026-09-03 20:00 UTC (permalink / raw) To: Krzysztof Kozlowski 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 Hi Krzysztof, On 15:45-20260903, Krzysztof Kozlowski wrote: > On Wed, Sep 02, 2026 at 04:03:27PM -0500, Kendall Willis wrote: > > Add "ti,am62-m_can" to the list of compatible strings for the M_CAN > > Compatibles do not have underscores. Poor existing examples are not the > example to follow. > I'll change it to "ti,am62-mcu-mcan" in the next revision. > Also, no need to repeat the diff - we see that from the diff. Just say > "Add foo bar, a baz-baz device, fully compatible or not compatible with > Bosch because of this and that". > Noted. Best, Kendall ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 2/2] can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support 2026-09-02 21:03 [PATCH v4 0/2] can: m_can: introduce ti,am62-m_can compatible for out-of-band wakeup Kendall Willis 2026-09-02 21:03 ` [PATCH v4 1/2] dt-bindings: can: m_can: add ti,am62-m_can compatible Kendall Willis @ 2026-09-02 21:03 ` Kendall Willis 2026-09-03 8:55 ` Markus Schneider-Pargmann 2026-09-03 13:46 ` Krzysztof Kozlowski 1 sibling, 2 replies; 11+ messages in thread From: Kendall Willis @ 2026-09-02 21:03 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 controller is a part of the MCU power domain which is OFF in the deepest low power states. However, the m_can pins are able to wakeup the system from states where the MCU domain is OFF through its out-of-band wakeup functionality. Introduce the ti,am62-m_can compatible with match data to identify the out-of-band wakeup capability for TI AM62 SoCs. During suspend, set the out-of-band wakeup flag when the device is configured as a wakeup source, the "wakeup" pinctrl state is present, and the match data indicates out-of-band wakeup support. Signed-off-by: Kendall Willis <k-willis@ti.com> --- drivers/net/can/m_can/m_can.c | 7 ++++++- drivers/net/can/m_can/m_can.h | 4 ++++ drivers/net/can/m_can/m_can_platform.c | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index 16f80607e150e2ca2950616ff2c39b7aa13710b4..0788816d881ef8ba84ad5a84a6d2d3e60517ea7a 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -2598,6 +2598,7 @@ int m_can_class_suspend(struct device *dev) { struct m_can_classdev *cdev = dev_get_drvdata(dev); struct net_device *ndev = cdev->net; + const struct m_can_pdata *pdata = of_device_get_match_data(dev); int ret = 0; if (netif_running(ndev)) { @@ -2622,8 +2623,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 (pdata && pdata->out_band_wakeup) + device_set_out_band_wakeup(dev); + } else { pinctrl_pm_select_sleep_state(dev); + } return ret; } diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h index 4743342b2fba3823819b9e2bc5b085cc0fe6d1e2..486d808bc677482acf446b1450c3a9b6b7405178 100644 --- a/drivers/net/can/m_can/m_can.h +++ b/drivers/net/can/m_can/m_can.h @@ -134,6 +134,10 @@ struct m_can_classdev { struct pinctrl_state *pinctrl_state_wakeup; }; +struct m_can_pdata { + bool out_band_wakeup; +}; + struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv); void m_can_class_free_dev(struct net_device *net); int m_can_class_register(struct m_can_classdev *cdev); diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c index 56da411878af0185ff9cc512e325137428a68255..ae2d89b65fe8da65b1ca73cbf80cd8ee8483e2e8 100644 --- a/drivers/net/can/m_can/m_can_platform.c +++ b/drivers/net/can/m_can/m_can_platform.c @@ -218,8 +218,13 @@ static const struct dev_pm_ops m_can_pmops = { SET_SYSTEM_SLEEP_PM_OPS(m_can_suspend, m_can_resume) }; +static const struct m_can_pdata m_can_plat_am62 = { + .out_band_wakeup = true, +}; + static const struct of_device_id m_can_of_table[] = { { .compatible = "bosch,m_can", .data = NULL }, + { .compatible = "ti,am62-m_can", .data = &m_can_plat_am62 }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, m_can_of_table); -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support 2026-09-02 21:03 ` [PATCH v4 2/2] can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support Kendall Willis @ 2026-09-03 8:55 ` Markus Schneider-Pargmann 2026-09-03 19:22 ` Kendall Willis 2026-09-03 13:46 ` Krzysztof Kozlowski 1 sibling, 1 reply; 11+ messages in thread From: Markus Schneider-Pargmann @ 2026-09-03 8:55 UTC (permalink / raw) To: Kendall Willis, Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chandrasekar Ramakrishnan Cc: s-kochidanadu, a-kaur, s-tripathi1, vishalm, linux-can, devicetree, linux-kernel [-- Attachment #1: Type: text/plain, Size: 3745 bytes --] On Wed Sep 2, 2026 at 11:03 PM CEST, Kendall Willis wrote: > In TI AM62X, AM62A, and AM62P SoCs, the M_CAN controller is a part of > the MCU power domain which is OFF in the deepest low power states. > However, the m_can pins are able to wakeup the system from states where > the MCU domain is OFF through its out-of-band wakeup functionality. There are m_can devices in the main domain as well. Does this apply to these as well? > > Introduce the ti,am62-m_can compatible with match data to identify the > out-of-band wakeup capability for TI AM62 SoCs. During suspend, set the > out-of-band wakeup flag when the device is configured as a wakeup > source, the "wakeup" pinctrl state is present, and the match data > indicates out-of-band wakeup support. > > Signed-off-by: Kendall Willis <k-willis@ti.com> > --- > drivers/net/can/m_can/m_can.c | 7 ++++++- > drivers/net/can/m_can/m_can.h | 4 ++++ > drivers/net/can/m_can/m_can_platform.c | 5 +++++ > 3 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c > index 16f80607e150e2ca2950616ff2c39b7aa13710b4..0788816d881ef8ba84ad5a84a6d2d3e60517ea7a 100644 > --- a/drivers/net/can/m_can/m_can.c > +++ b/drivers/net/can/m_can/m_can.c > @@ -2598,6 +2598,7 @@ int m_can_class_suspend(struct device *dev) > { > struct m_can_classdev *cdev = dev_get_drvdata(dev); > struct net_device *ndev = cdev->net; > + const struct m_can_pdata *pdata = of_device_get_match_data(dev); The core m_can driver works for all m_can forms, tcan, platform and pci. I think it would be cleaner if you parse this in the platform driver and set it in m_can_classdev instead. Otherwise of_match_data has to be the same for all drivers which is not obvious when you are editing tcan for example. > int ret = 0; > > if (netif_running(ndev)) { > @@ -2622,8 +2623,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 (pdata && pdata->out_band_wakeup) > + device_set_out_band_wakeup(dev); > + } else { > pinctrl_pm_select_sleep_state(dev); > + } I just noticed these are called even if ret is not 0, so suspend failed. This shouldn't happen, but not a problem of your patch. But you could add a fix for that. > > return ret; > } > diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h > index 4743342b2fba3823819b9e2bc5b085cc0fe6d1e2..486d808bc677482acf446b1450c3a9b6b7405178 100644 > --- a/drivers/net/can/m_can/m_can.h > +++ b/drivers/net/can/m_can/m_can.h > @@ -134,6 +134,10 @@ struct m_can_classdev { > struct pinctrl_state *pinctrl_state_wakeup; > }; > > +struct m_can_pdata { > + bool out_band_wakeup; > +}; > + > struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv); > void m_can_class_free_dev(struct net_device *net); > int m_can_class_register(struct m_can_classdev *cdev); > diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c > index 56da411878af0185ff9cc512e325137428a68255..ae2d89b65fe8da65b1ca73cbf80cd8ee8483e2e8 100644 > --- a/drivers/net/can/m_can/m_can_platform.c > +++ b/drivers/net/can/m_can/m_can_platform.c > @@ -218,8 +218,13 @@ static const struct dev_pm_ops m_can_pmops = { > SET_SYSTEM_SLEEP_PM_OPS(m_can_suspend, m_can_resume) > }; > > +static const struct m_can_pdata m_can_plat_am62 = { I don't like the pdata name here, this suggests to be platform data, but this is of match data instead. Maybe of_data? Best Markus [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 289 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support 2026-09-03 8:55 ` Markus Schneider-Pargmann @ 2026-09-03 19:22 ` Kendall Willis 0 siblings, 0 replies; 11+ messages in thread From: Kendall Willis @ 2026-09-03 19:22 UTC (permalink / raw) To: Markus Schneider-Pargmann Cc: 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 10:55-20260903, Markus Schneider-Pargmann wrote: > On Wed Sep 2, 2026 at 11:03 PM CEST, Kendall Willis wrote: > > In TI AM62X, AM62A, and AM62P SoCs, the M_CAN controller is a part of > > the MCU power domain which is OFF in the deepest low power states. > > However, the m_can pins are able to wakeup the system from states where > > the MCU domain is OFF through its out-of-band wakeup functionality. > > There are m_can devices in the main domain as well. Does this apply to > these as well? > This doesn't apply to the m_can devices in the main domain, so I'll make the compatible to be more specific. Maybe something like "ti,am62-mcu-mcan". > > > > Introduce the ti,am62-m_can compatible with match data to identify the > > out-of-band wakeup capability for TI AM62 SoCs. During suspend, set the > > out-of-band wakeup flag when the device is configured as a wakeup > > source, the "wakeup" pinctrl state is present, and the match data > > indicates out-of-band wakeup support. > > > > Signed-off-by: Kendall Willis <k-willis@ti.com> > > --- > > drivers/net/can/m_can/m_can.c | 7 ++++++- > > drivers/net/can/m_can/m_can.h | 4 ++++ > > drivers/net/can/m_can/m_can_platform.c | 5 +++++ > > 3 files changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c > > index 16f80607e150e2ca2950616ff2c39b7aa13710b4..0788816d881ef8ba84ad5a84a6d2d3e60517ea7a 100644 > > --- a/drivers/net/can/m_can/m_can.c > > +++ b/drivers/net/can/m_can/m_can.c > > @@ -2598,6 +2598,7 @@ int m_can_class_suspend(struct device *dev) > > { > > struct m_can_classdev *cdev = dev_get_drvdata(dev); > > struct net_device *ndev = cdev->net; > > + const struct m_can_pdata *pdata = of_device_get_match_data(dev); > > The core m_can driver works for all m_can forms, tcan, platform and pci. > I think it would be cleaner if you parse this in the platform driver and > set it in m_can_classdev instead. Otherwise of_match_data has to be the > same for all drivers which is not obvious when you are editing tcan for > example. > That makes sense. I'll add it to m_can_classdev in the platform driver in the next version. > > int ret = 0; > > > > if (netif_running(ndev)) { > > @@ -2622,8 +2623,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 (pdata && pdata->out_band_wakeup) > > + device_set_out_band_wakeup(dev); > > + } else { > > pinctrl_pm_select_sleep_state(dev); > > + } > > I just noticed these are called even if ret is not 0, so suspend failed. > This shouldn't happen, but not a problem of your patch. But you could > add a fix for that. > Yep, I could add a fix for that. > > > > return ret; > > } > > diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h > > index 4743342b2fba3823819b9e2bc5b085cc0fe6d1e2..486d808bc677482acf446b1450c3a9b6b7405178 100644 > > --- a/drivers/net/can/m_can/m_can.h > > +++ b/drivers/net/can/m_can/m_can.h > > @@ -134,6 +134,10 @@ struct m_can_classdev { > > struct pinctrl_state *pinctrl_state_wakeup; > > }; > > > > +struct m_can_pdata { > > + bool out_band_wakeup; > > +}; > > + > > struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv); > > void m_can_class_free_dev(struct net_device *net); > > int m_can_class_register(struct m_can_classdev *cdev); > > diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c > > index 56da411878af0185ff9cc512e325137428a68255..ae2d89b65fe8da65b1ca73cbf80cd8ee8483e2e8 100644 > > --- a/drivers/net/can/m_can/m_can_platform.c > > +++ b/drivers/net/can/m_can/m_can_platform.c > > @@ -218,8 +218,13 @@ static const struct dev_pm_ops m_can_pmops = { > > SET_SYSTEM_SLEEP_PM_OPS(m_can_suspend, m_can_resume) > > }; > > > > +static const struct m_can_pdata m_can_plat_am62 = { > > I don't like the pdata name here, this suggests to be platform data, but > this is of match data instead. Maybe of_data? I can change it to of_data. I've also seen soc_data as well, but that doesn't really work since the compatible is per power domain. Best, Kendall ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support 2026-09-02 21:03 ` [PATCH v4 2/2] can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support Kendall Willis 2026-09-03 8:55 ` Markus Schneider-Pargmann @ 2026-09-03 13:46 ` Krzysztof Kozlowski 2026-09-03 21:47 ` Kendall Willis 1 sibling, 1 reply; 11+ messages in thread From: Krzysztof Kozlowski @ 2026-09-03 13:46 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 On Wed, Sep 02, 2026 at 04:03:28PM -0500, Kendall Willis wrote: > +struct m_can_pdata { > + bool out_band_wakeup; > +}; > + > struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv); > void m_can_class_free_dev(struct net_device *net); > int m_can_class_register(struct m_can_classdev *cdev); > diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c > index 56da411878af0185ff9cc512e325137428a68255..ae2d89b65fe8da65b1ca73cbf80cd8ee8483e2e8 100644 > --- a/drivers/net/can/m_can/m_can_platform.c > +++ b/drivers/net/can/m_can/m_can_platform.c > @@ -218,8 +218,13 @@ static const struct dev_pm_ops m_can_pmops = { > SET_SYSTEM_SLEEP_PM_OPS(m_can_suspend, m_can_resume) > }; > > +static const struct m_can_pdata m_can_plat_am62 = { > + .out_band_wakeup = true, > +}; > + > static const struct of_device_id m_can_of_table[] = { > { .compatible = "bosch,m_can", .data = NULL }, > + { .compatible = "ti,am62-m_can", .data = &m_can_plat_am62 }, How exactly having out of band wakeup makes this device INCOMPATIBLE with Bosch (in terms of DT compatibility)? Best regards, Krzysztof ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support 2026-09-03 13:46 ` Krzysztof Kozlowski @ 2026-09-03 21:47 ` Kendall Willis 0 siblings, 0 replies; 11+ messages in thread From: Kendall Willis @ 2026-09-03 21:47 UTC (permalink / raw) To: Krzysztof Kozlowski 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 Hi Krzysztof, On 15:46-20260903, Krzysztof Kozlowski wrote: > On Wed, Sep 02, 2026 at 04:03:28PM -0500, Kendall Willis wrote: > > +struct m_can_pdata { > > + bool out_band_wakeup; > > +}; > > + > > struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv); > > void m_can_class_free_dev(struct net_device *net); > > int m_can_class_register(struct m_can_classdev *cdev); > > diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c > > index 56da411878af0185ff9cc512e325137428a68255..ae2d89b65fe8da65b1ca73cbf80cd8ee8483e2e8 100644 > > --- a/drivers/net/can/m_can/m_can_platform.c > > +++ b/drivers/net/can/m_can/m_can_platform.c > > @@ -218,8 +218,13 @@ static const struct dev_pm_ops m_can_pmops = { > > SET_SYSTEM_SLEEP_PM_OPS(m_can_suspend, m_can_resume) > > }; > > > > +static const struct m_can_pdata m_can_plat_am62 = { > > + .out_band_wakeup = true, > > +}; > > + > > static const struct of_device_id m_can_of_table[] = { > > { .compatible = "bosch,m_can", .data = NULL }, > > + { .compatible = "ti,am62-m_can", .data = &m_can_plat_am62 }, > > How exactly having out of band wakeup makes this device INCOMPATIBLE > with Bosch (in terms of DT compatibility)? > It does not make it incompatible with Bosch. The DT binding is incorrect for having it be compatible with both TI and Bosch. I'm correcting it on the next revision. Best, Kendall ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-09-03 21:48 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-09-02 21:03 [PATCH v4 0/2] can: m_can: introduce ti,am62-m_can compatible for out-of-band wakeup Kendall Willis 2026-09-02 21:03 ` [PATCH v4 1/2] dt-bindings: can: m_can: add ti,am62-m_can compatible Kendall Willis 2026-09-03 8:28 ` Markus Schneider-Pargmann 2026-09-03 19:04 ` Kendall Willis 2026-09-03 13:45 ` Krzysztof Kozlowski 2026-09-03 20:00 ` Kendall Willis 2026-09-02 21:03 ` [PATCH v4 2/2] can: m_can: add ti,am62-m_can compatible with out-of-band wakeup support Kendall Willis 2026-09-03 8:55 ` Markus Schneider-Pargmann 2026-09-03 19:22 ` Kendall Willis 2026-09-03 13:46 ` Krzysztof Kozlowski 2026-09-03 21:47 ` Kendall Willis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox