mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm
@ 2026-02-04 11:11 Xu Yang
  2026-02-04 11:11 ` [PATCH v2 2/2] pmdomain: imx8mp-blk-ctrl: keep usb phy power domain on for wakeup Xu Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Xu Yang @ 2026-02-04 11:11 UTC (permalink / raw)
  To: ulf.hansson, Frank.Li, s.hauer, kernel, festevam, peng.fan,
	jun.li, rafael.j.wysocki, a.fatoum, ping.bai, shawnguo, l.stach
  Cc: linux-pm, imx, linux-arm-kernel, linux-kernel

Current design will power off all dependent GPC power domains in
imx8mp_blk_ctrl_suspend(), even though the user device has enabled
wakeup capability. The result is that wakeup function never works
for such device.

An example will be USB wakeup on i.MX8MP. PHY device '382f0040.usb-phy'
is attached to power domain 'hsioblk-usb-phy2' which is spawned by hsio
block control. A virtual power domain device 'genpd:3:32f10000.blk-ctrl'
is created to build connection with 'hsioblk-usb-phy2' and it depends on
GPC power domain 'usb-otg2'. If device '382f0040.usb-phy' enable wakeup,
only power domain 'hsioblk-usb-phy2' keeps on during system suspend,
power domain 'usb-otg2' is off all the time. So the wakeup event can't
happen.

In order to further establish a connection between the power domains
related to GPC and block control during system pm, register a notifier
to power_dev, so that GPC power domain will know that block control power
domain is on and will not power off itself.

Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Fixes: 556f5cf9568a ("soc: imx: add i.MX8MP HSIO blk-ctrl")
Cc: stable@kernel.org
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v2:
 - add notifier to support wakeup needs
---
 drivers/pmdomain/imx/imx8mp-blk-ctrl.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
index 34576be606e3..56bbfee8668d 100644
--- a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
+++ b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
@@ -65,6 +65,7 @@ struct imx8mp_blk_ctrl_domain {
 	struct icc_bulk_data paths[DOMAIN_MAX_PATHS];
 	struct device *power_dev;
 	struct imx8mp_blk_ctrl *bc;
+	struct notifier_block power_nb;
 	int num_paths;
 	int id;
 };
@@ -594,6 +595,20 @@ static int imx8mp_blk_ctrl_power_off(struct generic_pm_domain *genpd)
 	return 0;
 }
 
+static int imx8mp_blk_ctrl_gpc_notifier(struct notifier_block *nb,
+					unsigned long action, void *data)
+{
+	struct imx8mp_blk_ctrl_domain *domain =
+			container_of(nb, struct imx8mp_blk_ctrl_domain, power_nb);
+
+	if (action == GENPD_NOTIFY_PRE_OFF) {
+		if (domain->genpd.status == GENPD_STATE_ON)
+			return NOTIFY_BAD;
+	}
+
+	return NOTIFY_OK;
+}
+
 static struct lock_class_key blk_ctrl_genpd_lock_class;
 
 static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
@@ -698,6 +713,14 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
 			goto cleanup_pds;
 		}
 
+		domain->power_nb.notifier_call = imx8mp_blk_ctrl_gpc_notifier;
+		ret = dev_pm_genpd_add_notifier(domain->power_dev, &domain->power_nb);
+		if (ret) {
+			dev_err_probe(dev, ret, "failed to add power notifier\n");
+			dev_pm_domain_detach(domain->power_dev, true);
+			goto cleanup_pds;
+		}
+
 		domain->genpd.name = data->name;
 		domain->genpd.power_on = imx8mp_blk_ctrl_power_on;
 		domain->genpd.power_off = imx8mp_blk_ctrl_power_off;
@@ -707,6 +730,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
 		ret = pm_genpd_init(&domain->genpd, NULL, true);
 		if (ret) {
 			dev_err_probe(dev, ret, "failed to init power domain\n");
+			dev_pm_genpd_remove_notifier(domain->power_dev);
 			dev_pm_domain_detach(domain->power_dev, true);
 			goto cleanup_pds;
 		}
@@ -755,6 +779,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
 cleanup_pds:
 	for (i--; i >= 0; i--) {
 		pm_genpd_remove(&bc->domains[i].genpd);
+		dev_pm_genpd_remove_notifier(bc->domains[i].power_dev);
 		dev_pm_domain_detach(bc->domains[i].power_dev, true);
 	}
 
@@ -774,6 +799,7 @@ static void imx8mp_blk_ctrl_remove(struct platform_device *pdev)
 		struct imx8mp_blk_ctrl_domain *domain = &bc->domains[i];
 
 		pm_genpd_remove(&domain->genpd);
+		dev_pm_genpd_remove_notifier(domain->power_dev);
 		dev_pm_domain_detach(domain->power_dev, true);
 	}
 
-- 
2.34.1


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

* [PATCH v2 2/2] pmdomain: imx8mp-blk-ctrl: keep usb phy power domain on for wakeup
  2026-02-04 11:11 [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm Xu Yang
@ 2026-02-04 11:11 ` Xu Yang
  2026-02-05 10:56   ` Ulf Hansson
  2026-02-05 10:56 ` [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm Ulf Hansson
  2026-07-23 12:49 ` Frieder Schrempf
  2 siblings, 1 reply; 6+ messages in thread
From: Xu Yang @ 2026-02-04 11:11 UTC (permalink / raw)
  To: ulf.hansson, Frank.Li, s.hauer, kernel, festevam, peng.fan,
	jun.li, rafael.j.wysocki, a.fatoum, ping.bai, shawnguo, l.stach
  Cc: linux-pm, imx, linux-arm-kernel, linux-kernel

USB remote wakeup need its PHY on, so add USB PHY power domain on active
flag.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes in v2:
 - add flag to block control related power domain
---
 drivers/pmdomain/imx/imx8mp-blk-ctrl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
index 56bbfee8668d..8fc79f9723f0 100644
--- a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
+++ b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
@@ -53,6 +53,7 @@ struct imx8mp_blk_ctrl_domain_data {
 	const char * const *path_names;
 	int num_paths;
 	const char *gpc_name;
+	const unsigned int flags;
 };
 
 #define DOMAIN_MAX_CLKS 3
@@ -265,10 +266,12 @@ static const struct imx8mp_blk_ctrl_domain_data imx8mp_hsio_domain_data[] = {
 	[IMX8MP_HSIOBLK_PD_USB_PHY1] = {
 		.name = "hsioblk-usb-phy1",
 		.gpc_name = "usb-phy1",
+		.flags = GENPD_FLAG_ACTIVE_WAKEUP,
 	},
 	[IMX8MP_HSIOBLK_PD_USB_PHY2] = {
 		.name = "hsioblk-usb-phy2",
 		.gpc_name = "usb-phy2",
+		.flags = GENPD_FLAG_ACTIVE_WAKEUP,
 	},
 	[IMX8MP_HSIOBLK_PD_PCIE] = {
 		.name = "hsioblk-pcie",
@@ -724,6 +727,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
 		domain->genpd.name = data->name;
 		domain->genpd.power_on = imx8mp_blk_ctrl_power_on;
 		domain->genpd.power_off = imx8mp_blk_ctrl_power_off;
+		domain->genpd.flags = data->flags;
 		domain->bc = bc;
 		domain->id = i;
 
-- 
2.34.1


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

* Re: [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm
  2026-02-04 11:11 [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm Xu Yang
  2026-02-04 11:11 ` [PATCH v2 2/2] pmdomain: imx8mp-blk-ctrl: keep usb phy power domain on for wakeup Xu Yang
@ 2026-02-05 10:56 ` Ulf Hansson
  2026-07-23 12:49 ` Frieder Schrempf
  2 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2026-02-05 10:56 UTC (permalink / raw)
  To: Xu Yang
  Cc: Frank.Li, s.hauer, kernel, festevam, peng.fan, jun.li,
	rafael.j.wysocki, a.fatoum, ping.bai, shawnguo, l.stach,
	linux-pm, imx, linux-arm-kernel, linux-kernel

On Wed, 4 Feb 2026 at 12:10, Xu Yang <xu.yang_2@nxp.com> wrote:
>
> Current design will power off all dependent GPC power domains in
> imx8mp_blk_ctrl_suspend(), even though the user device has enabled
> wakeup capability. The result is that wakeup function never works
> for such device.
>
> An example will be USB wakeup on i.MX8MP. PHY device '382f0040.usb-phy'
> is attached to power domain 'hsioblk-usb-phy2' which is spawned by hsio
> block control. A virtual power domain device 'genpd:3:32f10000.blk-ctrl'
> is created to build connection with 'hsioblk-usb-phy2' and it depends on
> GPC power domain 'usb-otg2'. If device '382f0040.usb-phy' enable wakeup,
> only power domain 'hsioblk-usb-phy2' keeps on during system suspend,
> power domain 'usb-otg2' is off all the time. So the wakeup event can't
> happen.
>
> In order to further establish a connection between the power domains
> related to GPC and block control during system pm, register a notifier
> to power_dev, so that GPC power domain will know that block control power
> domain is on and will not power off itself.
>
> Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
> Fixes: 556f5cf9568a ("soc: imx: add i.MX8MP HSIO blk-ctrl")
> Cc: stable@kernel.org
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

Applied for fixes and by amending the commit message a little bit to
make it clearer, thanks!

Kind regards
Uffe


>
> ---
> Changes in v2:
>  - add notifier to support wakeup needs
> ---
>  drivers/pmdomain/imx/imx8mp-blk-ctrl.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
> index 34576be606e3..56bbfee8668d 100644
> --- a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
> +++ b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
> @@ -65,6 +65,7 @@ struct imx8mp_blk_ctrl_domain {
>         struct icc_bulk_data paths[DOMAIN_MAX_PATHS];
>         struct device *power_dev;
>         struct imx8mp_blk_ctrl *bc;
> +       struct notifier_block power_nb;
>         int num_paths;
>         int id;
>  };
> @@ -594,6 +595,20 @@ static int imx8mp_blk_ctrl_power_off(struct generic_pm_domain *genpd)
>         return 0;
>  }
>
> +static int imx8mp_blk_ctrl_gpc_notifier(struct notifier_block *nb,
> +                                       unsigned long action, void *data)
> +{
> +       struct imx8mp_blk_ctrl_domain *domain =
> +                       container_of(nb, struct imx8mp_blk_ctrl_domain, power_nb);
> +
> +       if (action == GENPD_NOTIFY_PRE_OFF) {
> +               if (domain->genpd.status == GENPD_STATE_ON)
> +                       return NOTIFY_BAD;
> +       }
> +
> +       return NOTIFY_OK;
> +}
> +
>  static struct lock_class_key blk_ctrl_genpd_lock_class;
>
>  static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
> @@ -698,6 +713,14 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
>                         goto cleanup_pds;
>                 }
>
> +               domain->power_nb.notifier_call = imx8mp_blk_ctrl_gpc_notifier;
> +               ret = dev_pm_genpd_add_notifier(domain->power_dev, &domain->power_nb);
> +               if (ret) {
> +                       dev_err_probe(dev, ret, "failed to add power notifier\n");
> +                       dev_pm_domain_detach(domain->power_dev, true);
> +                       goto cleanup_pds;
> +               }
> +
>                 domain->genpd.name = data->name;
>                 domain->genpd.power_on = imx8mp_blk_ctrl_power_on;
>                 domain->genpd.power_off = imx8mp_blk_ctrl_power_off;
> @@ -707,6 +730,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
>                 ret = pm_genpd_init(&domain->genpd, NULL, true);
>                 if (ret) {
>                         dev_err_probe(dev, ret, "failed to init power domain\n");
> +                       dev_pm_genpd_remove_notifier(domain->power_dev);
>                         dev_pm_domain_detach(domain->power_dev, true);
>                         goto cleanup_pds;
>                 }
> @@ -755,6 +779,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
>  cleanup_pds:
>         for (i--; i >= 0; i--) {
>                 pm_genpd_remove(&bc->domains[i].genpd);
> +               dev_pm_genpd_remove_notifier(bc->domains[i].power_dev);
>                 dev_pm_domain_detach(bc->domains[i].power_dev, true);
>         }
>
> @@ -774,6 +799,7 @@ static void imx8mp_blk_ctrl_remove(struct platform_device *pdev)
>                 struct imx8mp_blk_ctrl_domain *domain = &bc->domains[i];
>
>                 pm_genpd_remove(&domain->genpd);
> +               dev_pm_genpd_remove_notifier(domain->power_dev);
>                 dev_pm_domain_detach(domain->power_dev, true);
>         }
>
> --
> 2.34.1
>

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

* Re: [PATCH v2 2/2] pmdomain: imx8mp-blk-ctrl: keep usb phy power domain on for wakeup
  2026-02-04 11:11 ` [PATCH v2 2/2] pmdomain: imx8mp-blk-ctrl: keep usb phy power domain on for wakeup Xu Yang
@ 2026-02-05 10:56   ` Ulf Hansson
  0 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2026-02-05 10:56 UTC (permalink / raw)
  To: Xu Yang
  Cc: Frank.Li, s.hauer, kernel, festevam, peng.fan, jun.li,
	rafael.j.wysocki, a.fatoum, ping.bai, shawnguo, l.stach,
	linux-pm, imx, linux-arm-kernel, linux-kernel

On Wed, 4 Feb 2026 at 12:10, Xu Yang <xu.yang_2@nxp.com> wrote:
>
> USB remote wakeup need its PHY on, so add USB PHY power domain on active
> flag.
>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

Applied for fixes and by amending the commit message a little bit to
make it clearer, thanks!

I also added a fixes/stable tag, the same that we used for patch 1.

Kind regards
Uffe


>
> ---
> Changes in v2:
>  - add flag to block control related power domain
> ---
>  drivers/pmdomain/imx/imx8mp-blk-ctrl.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
> index 56bbfee8668d..8fc79f9723f0 100644
> --- a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
> +++ b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
> @@ -53,6 +53,7 @@ struct imx8mp_blk_ctrl_domain_data {
>         const char * const *path_names;
>         int num_paths;
>         const char *gpc_name;
> +       const unsigned int flags;
>  };
>
>  #define DOMAIN_MAX_CLKS 3
> @@ -265,10 +266,12 @@ static const struct imx8mp_blk_ctrl_domain_data imx8mp_hsio_domain_data[] = {
>         [IMX8MP_HSIOBLK_PD_USB_PHY1] = {
>                 .name = "hsioblk-usb-phy1",
>                 .gpc_name = "usb-phy1",
> +               .flags = GENPD_FLAG_ACTIVE_WAKEUP,
>         },
>         [IMX8MP_HSIOBLK_PD_USB_PHY2] = {
>                 .name = "hsioblk-usb-phy2",
>                 .gpc_name = "usb-phy2",
> +               .flags = GENPD_FLAG_ACTIVE_WAKEUP,
>         },
>         [IMX8MP_HSIOBLK_PD_PCIE] = {
>                 .name = "hsioblk-pcie",
> @@ -724,6 +727,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
>                 domain->genpd.name = data->name;
>                 domain->genpd.power_on = imx8mp_blk_ctrl_power_on;
>                 domain->genpd.power_off = imx8mp_blk_ctrl_power_off;
> +               domain->genpd.flags = data->flags;
>                 domain->bc = bc;
>                 domain->id = i;
>
> --
> 2.34.1
>

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

* Re: [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm
  2026-02-04 11:11 [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm Xu Yang
  2026-02-04 11:11 ` [PATCH v2 2/2] pmdomain: imx8mp-blk-ctrl: keep usb phy power domain on for wakeup Xu Yang
  2026-02-05 10:56 ` [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm Ulf Hansson
@ 2026-07-23 12:49 ` Frieder Schrempf
  2026-07-23 13:01   ` Frieder Schrempf
  2 siblings, 1 reply; 6+ messages in thread
From: Frieder Schrempf @ 2026-07-23 12:49 UTC (permalink / raw)
  To: Xu Yang, ulf.hansson, Frank.Li, s.hauer, kernel, festevam,
	peng.fan, jun.li, rafael.j.wysocki, a.fatoum, ping.bai, shawnguo,
	l.stach
  Cc: linux-pm, imx, linux-arm-kernel, linux-kernel

Hi,

On 04.02.26 12:11, Xu Yang wrote:
> Current design will power off all dependent GPC power domains in
> imx8mp_blk_ctrl_suspend(), even though the user device has enabled
> wakeup capability. The result is that wakeup function never works
> for such device.
> 
> An example will be USB wakeup on i.MX8MP. PHY device '382f0040.usb-phy'
> is attached to power domain 'hsioblk-usb-phy2' which is spawned by hsio
> block control. A virtual power domain device 'genpd:3:32f10000.blk-ctrl'
> is created to build connection with 'hsioblk-usb-phy2' and it depends on
> GPC power domain 'usb-otg2'. If device '382f0040.usb-phy' enable wakeup,
> only power domain 'hsioblk-usb-phy2' keeps on during system suspend,
> power domain 'usb-otg2' is off all the time. So the wakeup event can't
> happen.
> 
> In order to further establish a connection between the power domains
> related to GPC and block control during system pm, register a notifier
> to power_dev, so that GPC power domain will know that block control power
> domain is on and will not power off itself.
> 
> Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
> Fixes: 556f5cf9568a ("soc: imx: add i.MX8MP HSIO blk-ctrl")
> Cc: stable@kernel.org
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
This patch got backported to v6.1.y and for me it breaks the boot on
i.MX8MP with the log below (tested with 6.1.175).

Reverting the two patches of this series fixes the issue. What is the
correct way to fix this for the 6.1 stable branch? Should the patches be
reverted?

Thanks
Frieder

[    1.164011] imx8mp-blk-ctrl 32fc0000.blk-ctrl: error -ENODEV: failed
to add power notifier
[    1.171108] Unable to handle kernel NULL pointer dereference at
virtual address 0000000000000210
[    1.179932] Mem abort info:
[    1.182731]   ESR = 0x0000000096000004
[    1.186492]   EC = 0x25: DABT (current EL), IL = 32 bits
[    1.191833]   SET = 0, FnV = 0
[    1.194891]   EA = 0, S1PTW = 0
[    1.198041]   FSC = 0x04: level 0 translation fault
[    1.202960] Data abort info:
[    1.205836]   ISV = 0, ISS = 0x00000004
[    1.209676]   CM = 0, WnR = 0
[    1.212662] [0000000000000210] user address but active_mm is swapper
[    1.219044] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[    1.225340] Modules linked in:
[    1.228403] CPU: 2 PID: 1 Comm: swapper/0 Not tainted
6.1.175-ktn-ked-0.0.0 #1
[    1.235663] Hardware name: Kontron BL i.MX8MP OSM-S (DT)
[    1.241001] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS
BTYPE=--)
[    1.247999] pc : dev_pm_domain_detach+0x0/0x40
[    1.252461] lr : imx8mp_blk_ctrl_probe+0x494/0x580
[    1.257276] sp : ffff80000997ba00
[    1.260601] x29: ffff80000997bb70 x28: ffff0000c0aaa9a0 x27:
00000000ffffffed
[    1.267774] x26: ffff800008e37c78 x25: ffff800008e37ab8 x24:
ffff800008e37af0
[    1.274949] x23: 0000000000000007 x22: ffff0000c0945010 x21:
0000000000000038
[    1.282124] x20: 0000000000000188 x19: ffff0000c0fa6580 x18:
ffffffffffffffff
[    1.289299] x17: 20646461206f7420 x16: 64656c696166203a x15:
5645444f4e452d20
[    1.296474] x14: 726f727265203a6c x13: 7265696669746f6e x12:
ffff80000962c280
[    1.303649] x11: 00000000000000dd x10: ffff80000962c280 x9 :
00000000ffffdfff
[    1.310824] x8 : ffff8000096dc280 x7 : 000000000002ffe8 x6 :
0000000000000000
[    1.318001] x5 : 80000000ffffe000 x4 : 0000000000000000 x3 :
0000000000000000
[    1.325174] x2 : 0000000000000000 x1 : 0000000000000001 x0 :
0000000000000000
[    1.332351] Call trace:
[    1.334801]  dev_pm_domain_detach+0x0/0x40
[    1.338913]  platform_probe+0x68/0xe0
[    1.342586]  really_probe+0xc0/0x3e0
[    1.346174]  __driver_probe_device+0x84/0x190
[    1.350549]  driver_probe_device+0x3c/0x110
[    1.354751]  __driver_attach+0xf4/0x200
[    1.358599]  bus_for_each_dev+0x74/0xe0
[    1.362451]  driver_attach+0x24/0x30
[    1.366038]  bus_add_driver+0x17c/0x240
[    1.369886]  driver_register+0x78/0x130
[    1.373736]  __platform_driver_register+0x24/0x30
[    1.378463]  imx8mp_blk_ctrl_driver_init+0x1c/0x28
[    1.383274]  do_one_initcall+0x48/0x2b0
[    1.387126]  kernel_init_freeable+0x22c/0x29c
[    1.391499]  kernel_init+0x24/0x134
[    1.395001]  ret_from_fork+0x10/0x20
[    1.398592] Code: d65f03c0 d65f03c0 00000000 00000000 (f9410802)
[    1.404715] ---[ end trace 0000000000000000 ]---


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

* Re: [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm
  2026-07-23 12:49 ` Frieder Schrempf
@ 2026-07-23 13:01   ` Frieder Schrempf
  0 siblings, 0 replies; 6+ messages in thread
From: Frieder Schrempf @ 2026-07-23 13:01 UTC (permalink / raw)
  To: Xu Yang, ulf.hansson, Frank.Li, s.hauer, kernel, festevam,
	peng.fan, jun.li, rafael.j.wysocki, a.fatoum, ping.bai, shawnguo,
	l.stach
  Cc: linux-pm, imx, linux-arm-kernel, linux-kernel

On 23.07.26 14:49, Frieder Schrempf wrote:
> Hi,
> 
> On 04.02.26 12:11, Xu Yang wrote:
>> Current design will power off all dependent GPC power domains in
>> imx8mp_blk_ctrl_suspend(), even though the user device has enabled
>> wakeup capability. The result is that wakeup function never works
>> for such device.
>>
>> An example will be USB wakeup on i.MX8MP. PHY device '382f0040.usb-phy'
>> is attached to power domain 'hsioblk-usb-phy2' which is spawned by hsio
>> block control. A virtual power domain device 'genpd:3:32f10000.blk-ctrl'
>> is created to build connection with 'hsioblk-usb-phy2' and it depends on
>> GPC power domain 'usb-otg2'. If device '382f0040.usb-phy' enable wakeup,
>> only power domain 'hsioblk-usb-phy2' keeps on during system suspend,
>> power domain 'usb-otg2' is off all the time. So the wakeup event can't
>> happen.
>>
>> In order to further establish a connection between the power domains
>> related to GPC and block control during system pm, register a notifier
>> to power_dev, so that GPC power domain will know that block control power
>> domain is on and will not power off itself.
>>
>> Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
>> Fixes: 556f5cf9568a ("soc: imx: add i.MX8MP HSIO blk-ctrl")
>> Cc: stable@kernel.org
>> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> This patch got backported to v6.1.y and for me it breaks the boot on
> i.MX8MP with the log below (tested with 6.1.175).
> 
> Reverting the two patches of this series fixes the issue. What is the
> correct way to fix this for the 6.1 stable branch? Should the patches be
> reverted?
> 

Ah, this is probably related to the fact, that I also carry backported
HDMI support in our 6.1 tree. This likely triggers the exception and I'm
probably the only one seeing this as this is specific to our tree.

> Thanks
> Frieder
> 
> [    1.164011] imx8mp-blk-ctrl 32fc0000.blk-ctrl: error -ENODEV: failed
> to add power notifier
> [    1.171108] Unable to handle kernel NULL pointer dereference at
> virtual address 0000000000000210
> [    1.179932] Mem abort info:
> [    1.182731]   ESR = 0x0000000096000004
> [    1.186492]   EC = 0x25: DABT (current EL), IL = 32 bits
> [    1.191833]   SET = 0, FnV = 0
> [    1.194891]   EA = 0, S1PTW = 0
> [    1.198041]   FSC = 0x04: level 0 translation fault
> [    1.202960] Data abort info:
> [    1.205836]   ISV = 0, ISS = 0x00000004
> [    1.209676]   CM = 0, WnR = 0
> [    1.212662] [0000000000000210] user address but active_mm is swapper
> [    1.219044] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
> [    1.225340] Modules linked in:
> [    1.228403] CPU: 2 PID: 1 Comm: swapper/0 Not tainted
> 6.1.175-ktn-ked-0.0.0 #1
> [    1.235663] Hardware name: Kontron BL i.MX8MP OSM-S (DT)
> [    1.241001] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS
> BTYPE=--)
> [    1.247999] pc : dev_pm_domain_detach+0x0/0x40
> [    1.252461] lr : imx8mp_blk_ctrl_probe+0x494/0x580
> [    1.257276] sp : ffff80000997ba00
> [    1.260601] x29: ffff80000997bb70 x28: ffff0000c0aaa9a0 x27:
> 00000000ffffffed
> [    1.267774] x26: ffff800008e37c78 x25: ffff800008e37ab8 x24:
> ffff800008e37af0
> [    1.274949] x23: 0000000000000007 x22: ffff0000c0945010 x21:
> 0000000000000038
> [    1.282124] x20: 0000000000000188 x19: ffff0000c0fa6580 x18:
> ffffffffffffffff
> [    1.289299] x17: 20646461206f7420 x16: 64656c696166203a x15:
> 5645444f4e452d20
> [    1.296474] x14: 726f727265203a6c x13: 7265696669746f6e x12:
> ffff80000962c280
> [    1.303649] x11: 00000000000000dd x10: ffff80000962c280 x9 :
> 00000000ffffdfff
> [    1.310824] x8 : ffff8000096dc280 x7 : 000000000002ffe8 x6 :
> 0000000000000000
> [    1.318001] x5 : 80000000ffffe000 x4 : 0000000000000000 x3 :
> 0000000000000000
> [    1.325174] x2 : 0000000000000000 x1 : 0000000000000001 x0 :
> 0000000000000000
> [    1.332351] Call trace:
> [    1.334801]  dev_pm_domain_detach+0x0/0x40
> [    1.338913]  platform_probe+0x68/0xe0
> [    1.342586]  really_probe+0xc0/0x3e0
> [    1.346174]  __driver_probe_device+0x84/0x190
> [    1.350549]  driver_probe_device+0x3c/0x110
> [    1.354751]  __driver_attach+0xf4/0x200
> [    1.358599]  bus_for_each_dev+0x74/0xe0
> [    1.362451]  driver_attach+0x24/0x30
> [    1.366038]  bus_add_driver+0x17c/0x240
> [    1.369886]  driver_register+0x78/0x130
> [    1.373736]  __platform_driver_register+0x24/0x30
> [    1.378463]  imx8mp_blk_ctrl_driver_init+0x1c/0x28
> [    1.383274]  do_one_initcall+0x48/0x2b0
> [    1.387126]  kernel_init_freeable+0x22c/0x29c
> [    1.391499]  kernel_init+0x24/0x134
> [    1.395001]  ret_from_fork+0x10/0x20
> [    1.398592] Code: d65f03c0 d65f03c0 00000000 00000000 (f9410802)
> [    1.404715] ---[ end trace 0000000000000000 ]---
> 
> 


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

end of thread, other threads:[~2026-07-23 13:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-04 11:11 [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm Xu Yang
2026-02-04 11:11 ` [PATCH v2 2/2] pmdomain: imx8mp-blk-ctrl: keep usb phy power domain on for wakeup Xu Yang
2026-02-05 10:56   ` Ulf Hansson
2026-02-05 10:56 ` [PATCH v2 1/2] pmdomain: imx8mp-blk-ctrl: keep gpc power domain on if blk-ctrl pd is on during system pm Ulf Hansson
2026-07-23 12:49 ` Frieder Schrempf
2026-07-23 13:01   ` Frieder Schrempf

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

all inboxes | Powered by JetHome®