* [PATCH v3 0/4] pmdomain: core: Introduce device_set/get_out_band_wakeup and use it in usb
@ 2025-09-02 3:32 Peng Fan
2025-09-02 3:33 ` [PATCH v3 1/4] pmdomain: core: Introduce device_set/get_out_band_wakeup() Peng Fan
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Peng Fan @ 2025-09-02 3:32 UTC (permalink / raw)
To: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Peter Chen, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Thinh Nguyen,
Vincent Guittot, Xu Yang
Cc: linux-pm, linux-kernel, linux-usb, imx, arm-scmi,
linux-arm-kernel, Peng Fan
This is pick up of [1] which does not have response in about 5 months.
This V2 patchset
- includes usb driver changes(patch 2,3) to give people a full picture on how it is used.
- Rebased next-20250729 to resolve conflicts
To i.MX95, USB2 and USB3 are in HSIOMIX, but there is always on logic
to make USB2 and USB3 has wakeup capability when HSIOMIX power domain
is in off state. Otherwise the HSIOMIX will be kept on when
USB2 and USB3 are configured to be wakeup source and Linux suspended.
With this patchset, HSIOMIX could be powered off and Linux could still
be woke up by USB hotplug event.
Patch 1 introduces device_set/get_out_band_wakeup
Patch 2 and 3 are drivers changes to use device_set_out_band_wakeup
[1]https://lore.kernel.org/linux-pm/20250311083239.3336439-1-peng.fan@oss.nxp.com/
More old discussions:
https://lore.kernel.org/linux-pm/20250311083239.3336439-1-peng.fan@oss.nxp.com/
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Changes in v3:
- Add a new patch from Xu Yang to detach power domain for ci hdrc
- Add A-b for patch 4
- Link to v2: https://lore.kernel.org/r/20250801-pm-v2-0-97c8fb2a433c@nxp.com
---
Peng Fan (3):
pmdomain: core: Introduce device_set/get_out_band_wakeup()
usb: chipidea: ci_hdrc_imx: Set out of band wakeup for i.MX95
usb: dwc3: imx8mp: Set out of band wakeup for i.MX95
Xu Yang (1):
usb: chipidea: core: detach power domain for ci_hdrc platform device
drivers/pmdomain/core.c | 6 ++++--
drivers/usb/chipidea/ci_hdrc_imx.c | 8 ++++++++
drivers/usb/chipidea/core.c | 3 +++
drivers/usb/dwc3/dwc3-imx8mp.c | 4 ++++
include/linux/pm.h | 1 +
include/linux/pm_wakeup.h | 17 +++++++++++++++++
include/linux/usb/chipidea.h | 1 +
7 files changed, 38 insertions(+), 2 deletions(-)
---
base-commit: 1b09efec32046a9c78cfecc46a26b1b139a3e8a8
change-id: 20250729-pm-243ff7097e44
Best regards,
--
Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 1/4] pmdomain: core: Introduce device_set/get_out_band_wakeup()
2025-09-02 3:32 [PATCH v3 0/4] pmdomain: core: Introduce device_set/get_out_band_wakeup and use it in usb Peng Fan
@ 2025-09-02 3:33 ` Peng Fan
2025-09-02 8:53 ` Xu Yang
2025-09-02 3:33 ` [PATCH v3 2/4] usb: chipidea: core: detach power domain for ci_hdrc platform device Peng Fan
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Peng Fan @ 2025-09-02 3:33 UTC (permalink / raw)
To: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Peter Chen, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Thinh Nguyen,
Vincent Guittot, Xu Yang
Cc: linux-pm, linux-kernel, linux-usb, imx, arm-scmi,
linux-arm-kernel, Peng Fan
For some cases, a device could still wakeup the system even if its power
domain is in off state, because the device's wakeup hardware logic is
in an always-on domain.
To support this case, introduce device_set/get_out_band_wakeup() to
allow device drivers to control the behaviour in genpd for a device
that is attached to it.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/pmdomain/core.c | 6 ++++--
include/linux/pm.h | 1 +
include/linux/pm_wakeup.h | 17 +++++++++++++++++
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
index 0006ab3d078972cc72a6dd22a2144fb31443e3da..8e37758cea88a9ee051ad9fb13bdd3feb4f8745e 100644
--- a/drivers/pmdomain/core.c
+++ b/drivers/pmdomain/core.c
@@ -1549,7 +1549,8 @@ static int genpd_finish_suspend(struct device *dev,
if (ret)
return ret;
- if (device_awake_path(dev) && genpd_is_active_wakeup(genpd))
+ if (device_awake_path(dev) && genpd_is_active_wakeup(genpd) &&
+ !device_get_out_band_wakeup(dev))
return 0;
if (genpd->dev_ops.stop && genpd->dev_ops.start &&
@@ -1604,7 +1605,8 @@ static int genpd_finish_resume(struct device *dev,
if (IS_ERR(genpd))
return -EINVAL;
- if (device_awake_path(dev) && genpd_is_active_wakeup(genpd))
+ if (device_awake_path(dev) && genpd_is_active_wakeup(genpd) &&
+ !device_get_out_band_wakeup(dev))
return resume_noirq(dev);
genpd_lock(genpd);
diff --git a/include/linux/pm.h b/include/linux/pm.h
index cc7b2dc28574c24ece2f651352d4d23ecaf15f31..5b28a4f2e87e2aa34acc709e146ce729acace344 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -684,6 +684,7 @@ struct dev_pm_info {
bool smart_suspend:1; /* Owned by the PM core */
bool must_resume:1; /* Owned by the PM core */
bool may_skip_resume:1; /* Set by subsystems */
+ bool out_band_wakeup:1;
bool strict_midlayer:1;
#else
bool should_wakeup:1;
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index c838b4a30f876ef5a66972d16f461cfba9ff2814..c461c7edef6f7927d696b7d18b59a6a1147f53a3 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -94,6 +94,16 @@ static inline void device_set_wakeup_path(struct device *dev)
dev->power.wakeup_path = true;
}
+static inline void device_set_out_band_wakeup(struct device *dev, bool capable)
+{
+ dev->power.out_band_wakeup = capable;
+}
+
+static inline bool device_get_out_band_wakeup(struct device *dev)
+{
+ return dev->power.out_band_wakeup;
+}
+
/* drivers/base/power/wakeup.c */
extern struct wakeup_source *wakeup_source_register(struct device *dev,
const char *name);
@@ -162,6 +172,13 @@ static inline bool device_wakeup_path(struct device *dev)
static inline void device_set_wakeup_path(struct device *dev) {}
+static inline void device_set_out_band_wakeup(struct device *dev, bool capable) {}
+
+static inline bool device_get_out_band_wakeup(struct device *dev)
+{
+ return false;
+}
+
static inline void __pm_stay_awake(struct wakeup_source *ws) {}
static inline void pm_stay_awake(struct device *dev) {}
--
2.37.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v3 2/4] usb: chipidea: core: detach power domain for ci_hdrc platform device
2025-09-02 3:32 [PATCH v3 0/4] pmdomain: core: Introduce device_set/get_out_band_wakeup and use it in usb Peng Fan
2025-09-02 3:33 ` [PATCH v3 1/4] pmdomain: core: Introduce device_set/get_out_band_wakeup() Peng Fan
@ 2025-09-02 3:33 ` Peng Fan
2025-09-02 8:54 ` Xu Yang
2025-09-02 3:33 ` [PATCH v3 3/4] usb: chipidea: ci_hdrc_imx: Set out of band wakeup for i.MX95 Peng Fan
2025-09-02 3:33 ` [PATCH v3 4/4] usb: dwc3: imx8mp: " Peng Fan
3 siblings, 1 reply; 9+ messages in thread
From: Peng Fan @ 2025-09-02 3:33 UTC (permalink / raw)
To: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Peter Chen, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Thinh Nguyen,
Vincent Guittot, Xu Yang
Cc: linux-pm, linux-kernel, linux-usb, imx, arm-scmi,
linux-arm-kernel, Peng Fan
From: Xu Yang <xu.yang_2@nxp.com>
When add a platform device by calling ci_hdrc_add_device(), this device
will reuse OF node of its parent device. If power-domains property is
provided in the OF node, both two platform devices will be attached to
the same power domain. This should be unnecessary and may bring other
inconsistent behavior. For example, to support wakeup capability, these
two platform device need different power domain state. The parent device
need NOT power domain on for out-band interrupt, but the ci_hdrc device
need power domain on for in-band interrupt. The i.MX95 Soc support
out-band wakeup interrupt, the user need to enable wakeup for the parent
device, but if the user also enable wakeup for ci_hdrc device, the power
domain will keep at on state finally. To exclude such inconsistent
behavior and simplify the power management, detach power domain for ci_hdrc
platform device.
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
drivers/usb/chipidea/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 694b4a8e4e1d8583dcbf4a42f8c2dfd785d5745c..70597f40b9997a9766934c67bbbed38e96c210f8 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -27,6 +27,7 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
+#include <linux/pm_domain.h>
#include <linux/pinctrl/consumer.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
@@ -915,6 +916,8 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,
if (ret)
goto err;
+ dev_pm_domain_detach(&pdev->dev, false);
+
return pdev;
err:
--
2.37.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v3 3/4] usb: chipidea: ci_hdrc_imx: Set out of band wakeup for i.MX95
2025-09-02 3:32 [PATCH v3 0/4] pmdomain: core: Introduce device_set/get_out_band_wakeup and use it in usb Peng Fan
2025-09-02 3:33 ` [PATCH v3 1/4] pmdomain: core: Introduce device_set/get_out_band_wakeup() Peng Fan
2025-09-02 3:33 ` [PATCH v3 2/4] usb: chipidea: core: detach power domain for ci_hdrc platform device Peng Fan
@ 2025-09-02 3:33 ` Peng Fan
2025-09-02 8:55 ` Xu Yang
2025-09-02 3:33 ` [PATCH v3 4/4] usb: dwc3: imx8mp: " Peng Fan
3 siblings, 1 reply; 9+ messages in thread
From: Peng Fan @ 2025-09-02 3:33 UTC (permalink / raw)
To: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Peter Chen, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Thinh Nguyen,
Vincent Guittot, Xu Yang
Cc: linux-pm, linux-kernel, linux-usb, imx, arm-scmi,
linux-arm-kernel, Peng Fan
i.MX95 USB2 inside HSIOMIX could still wakeup Linux, even if HSIOMIX
power domain(Digital logic) is off. There is still always on logic
have the wakeup capability which is out band wakeup capbility.
So use device_set_out_band_wakeup for i.MX95 to make sure usb2 could
wakeup system even if HSIOMIX power domain is in off state.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/usb/chipidea/ci_hdrc_imx.c | 8 ++++++++
include/linux/usb/chipidea.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index d7c2a1a3c2715967203b98c819fa864e06a00a32..a2b3f673dfc1183a02783bf6ef92f8570c6042cf 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -79,6 +79,10 @@ static const struct ci_hdrc_imx_platform_flag imx8ulp_usb_data = {
CI_HDRC_HAS_PORTSC_PEC_MISSED,
};
+static const struct ci_hdrc_imx_platform_flag imx95_usb_data = {
+ .flags = CI_HDRC_SUPPORTS_RUNTIME_PM | CI_HDRC_OUT_BAND_WAKEUP,
+};
+
static const struct ci_hdrc_imx_platform_flag s32g_usb_data = {
.flags = CI_HDRC_DISABLE_HOST_STREAMING,
};
@@ -94,6 +98,7 @@ static const struct of_device_id ci_hdrc_imx_dt_ids[] = {
{ .compatible = "fsl,imx7d-usb", .data = &imx7d_usb_data},
{ .compatible = "fsl,imx7ulp-usb", .data = &imx7ulp_usb_data},
{ .compatible = "fsl,imx8ulp-usb", .data = &imx8ulp_usb_data},
+ { .compatible = "fsl,imx95-usb", .data = &imx95_usb_data},
{ .compatible = "nxp,s32g2-usb", .data = &s32g_usb_data},
{ /* sentinel */ }
};
@@ -570,6 +575,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
device_set_wakeup_capable(dev, true);
+ if (pdata.flags & CI_HDRC_OUT_BAND_WAKEUP)
+ device_set_out_band_wakeup(dev, true);
+
return 0;
disable_device:
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index e17ebeee24e3ecc4b1c2d153d9ea9b656b5a3d35..c6451191d2de68607a9380482701d11f949d0ff7 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -66,6 +66,7 @@ struct ci_hdrc_platform_data {
#define CI_HDRC_HAS_PORTSC_PEC_MISSED BIT(17)
#define CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS BIT(18)
#define CI_HDRC_HAS_SHORT_PKT_LIMIT BIT(19)
+#define CI_HDRC_OUT_BAND_WAKEUP BIT(20)
enum usb_dr_mode dr_mode;
#define CI_HDRC_CONTROLLER_RESET_EVENT 0
#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
--
2.37.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v3 4/4] usb: dwc3: imx8mp: Set out of band wakeup for i.MX95
2025-09-02 3:32 [PATCH v3 0/4] pmdomain: core: Introduce device_set/get_out_band_wakeup and use it in usb Peng Fan
` (2 preceding siblings ...)
2025-09-02 3:33 ` [PATCH v3 3/4] usb: chipidea: ci_hdrc_imx: Set out of band wakeup for i.MX95 Peng Fan
@ 2025-09-02 3:33 ` Peng Fan
2025-09-02 8:56 ` Xu Yang
3 siblings, 1 reply; 9+ messages in thread
From: Peng Fan @ 2025-09-02 3:33 UTC (permalink / raw)
To: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Peter Chen, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Thinh Nguyen,
Vincent Guittot, Xu Yang
Cc: linux-pm, linux-kernel, linux-usb, imx, arm-scmi,
linux-arm-kernel, Peng Fan
i.MX95 DWC3 inside HSIOMIX could still wakeup Linux, even if HSIOMIX
power domain(Digital logic) is off. There is still always on logic
have the wakeup capability which is out band wakeup capbility.
So use device_set_out_band_wakeup for i.MX95 to make sure DWC3 could
wakeup system even if HSIOMIX power domain is in off state.
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/usb/dwc3/dwc3-imx8mp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
index bce6af82f54c24423c1e1fcc46913c8456b6f035..fde158d1f6e3d89d261ed3689a17d703878c7e37 100644
--- a/drivers/usb/dwc3/dwc3-imx8mp.c
+++ b/drivers/usb/dwc3/dwc3-imx8mp.c
@@ -248,6 +248,10 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
}
device_set_wakeup_capable(dev, true);
+
+ if (device_is_compatible(dev, "fsl,imx95-dwc3"))
+ device_set_out_band_wakeup(dev, true);
+
pm_runtime_put(dev);
return 0;
--
2.37.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/4] pmdomain: core: Introduce device_set/get_out_band_wakeup()
2025-09-02 3:33 ` [PATCH v3 1/4] pmdomain: core: Introduce device_set/get_out_band_wakeup() Peng Fan
@ 2025-09-02 8:53 ` Xu Yang
0 siblings, 0 replies; 9+ messages in thread
From: Xu Yang @ 2025-09-02 8:53 UTC (permalink / raw)
To: Peng Fan
Cc: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Peter Chen, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Thinh Nguyen,
Vincent Guittot, linux-pm, linux-kernel, linux-usb, imx, arm-scmi,
linux-arm-kernel
On Tue, Sep 02, 2025 at 11:33:00AM +0800, Peng Fan wrote:
> For some cases, a device could still wakeup the system even if its power
> domain is in off state, because the device's wakeup hardware logic is
> in an always-on domain.
>
> To support this case, introduce device_set/get_out_band_wakeup() to
> allow device drivers to control the behaviour in genpd for a device
> that is attached to it.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Xu Yang <xu.yang_2@nxp.com>
> ---
> drivers/pmdomain/core.c | 6 ++++--
> include/linux/pm.h | 1 +
> include/linux/pm_wakeup.h | 17 +++++++++++++++++
> 3 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
> index 0006ab3d078972cc72a6dd22a2144fb31443e3da..8e37758cea88a9ee051ad9fb13bdd3feb4f8745e 100644
> --- a/drivers/pmdomain/core.c
> +++ b/drivers/pmdomain/core.c
> @@ -1549,7 +1549,8 @@ static int genpd_finish_suspend(struct device *dev,
> if (ret)
> return ret;
>
> - if (device_awake_path(dev) && genpd_is_active_wakeup(genpd))
> + if (device_awake_path(dev) && genpd_is_active_wakeup(genpd) &&
> + !device_get_out_band_wakeup(dev))
> return 0;
>
> if (genpd->dev_ops.stop && genpd->dev_ops.start &&
> @@ -1604,7 +1605,8 @@ static int genpd_finish_resume(struct device *dev,
> if (IS_ERR(genpd))
> return -EINVAL;
>
> - if (device_awake_path(dev) && genpd_is_active_wakeup(genpd))
> + if (device_awake_path(dev) && genpd_is_active_wakeup(genpd) &&
> + !device_get_out_band_wakeup(dev))
> return resume_noirq(dev);
>
> genpd_lock(genpd);
> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index cc7b2dc28574c24ece2f651352d4d23ecaf15f31..5b28a4f2e87e2aa34acc709e146ce729acace344 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -684,6 +684,7 @@ struct dev_pm_info {
> bool smart_suspend:1; /* Owned by the PM core */
> bool must_resume:1; /* Owned by the PM core */
> bool may_skip_resume:1; /* Set by subsystems */
> + bool out_band_wakeup:1;
> bool strict_midlayer:1;
> #else
> bool should_wakeup:1;
> diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
> index c838b4a30f876ef5a66972d16f461cfba9ff2814..c461c7edef6f7927d696b7d18b59a6a1147f53a3 100644
> --- a/include/linux/pm_wakeup.h
> +++ b/include/linux/pm_wakeup.h
> @@ -94,6 +94,16 @@ static inline void device_set_wakeup_path(struct device *dev)
> dev->power.wakeup_path = true;
> }
>
> +static inline void device_set_out_band_wakeup(struct device *dev, bool capable)
> +{
> + dev->power.out_band_wakeup = capable;
> +}
> +
> +static inline bool device_get_out_band_wakeup(struct device *dev)
> +{
> + return dev->power.out_band_wakeup;
> +}
> +
> /* drivers/base/power/wakeup.c */
> extern struct wakeup_source *wakeup_source_register(struct device *dev,
> const char *name);
> @@ -162,6 +172,13 @@ static inline bool device_wakeup_path(struct device *dev)
>
> static inline void device_set_wakeup_path(struct device *dev) {}
>
> +static inline void device_set_out_band_wakeup(struct device *dev, bool capable) {}
> +
> +static inline bool device_get_out_band_wakeup(struct device *dev)
> +{
> + return false;
> +}
> +
> static inline void __pm_stay_awake(struct wakeup_source *ws) {}
>
> static inline void pm_stay_awake(struct device *dev) {}
>
> --
> 2.37.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/4] usb: chipidea: core: detach power domain for ci_hdrc platform device
2025-09-02 3:33 ` [PATCH v3 2/4] usb: chipidea: core: detach power domain for ci_hdrc platform device Peng Fan
@ 2025-09-02 8:54 ` Xu Yang
0 siblings, 0 replies; 9+ messages in thread
From: Xu Yang @ 2025-09-02 8:54 UTC (permalink / raw)
To: Peng Fan
Cc: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Peter Chen, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Thinh Nguyen,
Vincent Guittot, linux-pm, linux-kernel, linux-usb, imx, arm-scmi,
linux-arm-kernel
On Tue, Sep 02, 2025 at 11:33:01AM +0800, Peng Fan wrote:
> From: Xu Yang <xu.yang_2@nxp.com>
>
> When add a platform device by calling ci_hdrc_add_device(), this device
> will reuse OF node of its parent device. If power-domains property is
> provided in the OF node, both two platform devices will be attached to
> the same power domain. This should be unnecessary and may bring other
> inconsistent behavior. For example, to support wakeup capability, these
> two platform device need different power domain state. The parent device
> need NOT power domain on for out-band interrupt, but the ci_hdrc device
> need power domain on for in-band interrupt. The i.MX95 Soc support
> out-band wakeup interrupt, the user need to enable wakeup for the parent
> device, but if the user also enable wakeup for ci_hdrc device, the power
> domain will keep at on state finally. To exclude such inconsistent
> behavior and simplify the power management, detach power domain for ci_hdrc
> platform device.
>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Tested-by: Xu Yang <xu.yang_2@nxp.com>
> ---
> drivers/usb/chipidea/core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 694b4a8e4e1d8583dcbf4a42f8c2dfd785d5745c..70597f40b9997a9766934c67bbbed38e96c210f8 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -27,6 +27,7 @@
> #include <linux/kernel.h>
> #include <linux/slab.h>
> #include <linux/pm_runtime.h>
> +#include <linux/pm_domain.h>
> #include <linux/pinctrl/consumer.h>
> #include <linux/usb/ch9.h>
> #include <linux/usb/gadget.h>
> @@ -915,6 +916,8 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,
> if (ret)
> goto err;
>
> + dev_pm_domain_detach(&pdev->dev, false);
> +
> return pdev;
>
> err:
>
> --
> 2.37.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 3/4] usb: chipidea: ci_hdrc_imx: Set out of band wakeup for i.MX95
2025-09-02 3:33 ` [PATCH v3 3/4] usb: chipidea: ci_hdrc_imx: Set out of band wakeup for i.MX95 Peng Fan
@ 2025-09-02 8:55 ` Xu Yang
0 siblings, 0 replies; 9+ messages in thread
From: Xu Yang @ 2025-09-02 8:55 UTC (permalink / raw)
To: Peng Fan
Cc: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Peter Chen, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Thinh Nguyen,
Vincent Guittot, linux-pm, linux-kernel, linux-usb, imx, arm-scmi,
linux-arm-kernel
On Tue, Sep 02, 2025 at 11:33:02AM +0800, Peng Fan wrote:
> i.MX95 USB2 inside HSIOMIX could still wakeup Linux, even if HSIOMIX
> power domain(Digital logic) is off. There is still always on logic
> have the wakeup capability which is out band wakeup capbility.
>
> So use device_set_out_band_wakeup for i.MX95 to make sure usb2 could
> wakeup system even if HSIOMIX power domain is in off state.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Xu Yang <xu.yang_2@nxp.com>
> ---
> drivers/usb/chipidea/ci_hdrc_imx.c | 8 ++++++++
> include/linux/usb/chipidea.h | 1 +
> 2 files changed, 9 insertions(+)
>
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index d7c2a1a3c2715967203b98c819fa864e06a00a32..a2b3f673dfc1183a02783bf6ef92f8570c6042cf 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -79,6 +79,10 @@ static const struct ci_hdrc_imx_platform_flag imx8ulp_usb_data = {
> CI_HDRC_HAS_PORTSC_PEC_MISSED,
> };
>
> +static const struct ci_hdrc_imx_platform_flag imx95_usb_data = {
> + .flags = CI_HDRC_SUPPORTS_RUNTIME_PM | CI_HDRC_OUT_BAND_WAKEUP,
> +};
> +
> static const struct ci_hdrc_imx_platform_flag s32g_usb_data = {
> .flags = CI_HDRC_DISABLE_HOST_STREAMING,
> };
> @@ -94,6 +98,7 @@ static const struct of_device_id ci_hdrc_imx_dt_ids[] = {
> { .compatible = "fsl,imx7d-usb", .data = &imx7d_usb_data},
> { .compatible = "fsl,imx7ulp-usb", .data = &imx7ulp_usb_data},
> { .compatible = "fsl,imx8ulp-usb", .data = &imx8ulp_usb_data},
> + { .compatible = "fsl,imx95-usb", .data = &imx95_usb_data},
> { .compatible = "nxp,s32g2-usb", .data = &s32g_usb_data},
> { /* sentinel */ }
> };
> @@ -570,6 +575,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
>
> device_set_wakeup_capable(dev, true);
>
> + if (pdata.flags & CI_HDRC_OUT_BAND_WAKEUP)
> + device_set_out_band_wakeup(dev, true);
> +
> return 0;
>
> disable_device:
> diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
> index e17ebeee24e3ecc4b1c2d153d9ea9b656b5a3d35..c6451191d2de68607a9380482701d11f949d0ff7 100644
> --- a/include/linux/usb/chipidea.h
> +++ b/include/linux/usb/chipidea.h
> @@ -66,6 +66,7 @@ struct ci_hdrc_platform_data {
> #define CI_HDRC_HAS_PORTSC_PEC_MISSED BIT(17)
> #define CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS BIT(18)
> #define CI_HDRC_HAS_SHORT_PKT_LIMIT BIT(19)
> +#define CI_HDRC_OUT_BAND_WAKEUP BIT(20)
> enum usb_dr_mode dr_mode;
> #define CI_HDRC_CONTROLLER_RESET_EVENT 0
> #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
>
> --
> 2.37.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 4/4] usb: dwc3: imx8mp: Set out of band wakeup for i.MX95
2025-09-02 3:33 ` [PATCH v3 4/4] usb: dwc3: imx8mp: " Peng Fan
@ 2025-09-02 8:56 ` Xu Yang
0 siblings, 0 replies; 9+ messages in thread
From: Xu Yang @ 2025-09-02 8:56 UTC (permalink / raw)
To: Peng Fan
Cc: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Peter Chen, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Thinh Nguyen,
Vincent Guittot, linux-pm, linux-kernel, linux-usb, imx, arm-scmi,
linux-arm-kernel
On Tue, Sep 02, 2025 at 11:33:03AM +0800, Peng Fan wrote:
> i.MX95 DWC3 inside HSIOMIX could still wakeup Linux, even if HSIOMIX
> power domain(Digital logic) is off. There is still always on logic
> have the wakeup capability which is out band wakeup capbility.
>
> So use device_set_out_band_wakeup for i.MX95 to make sure DWC3 could
> wakeup system even if HSIOMIX power domain is in off state.
>
> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Xu Yang <xu.yang_2@nxp.com>
> ---
> drivers/usb/dwc3/dwc3-imx8mp.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
> index bce6af82f54c24423c1e1fcc46913c8456b6f035..fde158d1f6e3d89d261ed3689a17d703878c7e37 100644
> --- a/drivers/usb/dwc3/dwc3-imx8mp.c
> +++ b/drivers/usb/dwc3/dwc3-imx8mp.c
> @@ -248,6 +248,10 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
> }
>
> device_set_wakeup_capable(dev, true);
> +
> + if (device_is_compatible(dev, "fsl,imx95-dwc3"))
> + device_set_out_band_wakeup(dev, true);
> +
> pm_runtime_put(dev);
>
> return 0;
>
> --
> 2.37.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-09-02 9:01 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 3:32 [PATCH v3 0/4] pmdomain: core: Introduce device_set/get_out_band_wakeup and use it in usb Peng Fan
2025-09-02 3:33 ` [PATCH v3 1/4] pmdomain: core: Introduce device_set/get_out_band_wakeup() Peng Fan
2025-09-02 8:53 ` Xu Yang
2025-09-02 3:33 ` [PATCH v3 2/4] usb: chipidea: core: detach power domain for ci_hdrc platform device Peng Fan
2025-09-02 8:54 ` Xu Yang
2025-09-02 3:33 ` [PATCH v3 3/4] usb: chipidea: ci_hdrc_imx: Set out of band wakeup for i.MX95 Peng Fan
2025-09-02 8:55 ` Xu Yang
2025-09-02 3:33 ` [PATCH v3 4/4] usb: dwc3: imx8mp: " Peng Fan
2025-09-02 8:56 ` Xu Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).