summaryrefslogtreecommitdiff
path: root/drivers/pmdomain
diff options
context:
space:
mode:
authorFrank Zhang <rmxpzlb@gmail.com>2025-12-16 13:52:47 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-01-30 10:32:26 +0100
commit8776dfa846d5c9dab5d1c3a262b4286b05ece87a (patch)
treeee3b544041163c2e1db64621dbf3dbe078bc2b57 /drivers/pmdomain
parentfd675de6bddf7e9bdf42ae3929d4c27ba6d1ef76 (diff)
pmdomain:rockchip: Fix init genpd as GENPD_STATE_ON before regulator ready
commit 861d21c43c98478eef70e68e31d4ff86400c6ef7 upstream. RK3588_PD_NPU initialize as GENPD_STATE_ON before regulator ready. rknn_iommu initlized success and suspend RK3588_PD_NPU. When rocket driver register, it will resume rknn_iommu. If regulator is still not ready at this point, rknn_iommu resume fail, pm runtime status will be error: -EPROBE_DEFER. This patch set pmdomain to off if it need regulator during probe, consumer device can power on pmdomain after regulator ready. Signed-off-by: Frank Zhang <rmxpzlb@gmail.com> Tested-by: Chaoyi Chen <chaoyi.chen@rock-chips.com> Tested-by: Quentin Schulz <quentin.schulz@cherry.de> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Fixes: db6df2e3fc16 ("pmdomain: rockchip: add regulator support") Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pmdomain')
-rw-r--r--drivers/pmdomain/rockchip/pm-domains.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
index 1955c6d453e4..5baaa6beb210 100644
--- a/drivers/pmdomain/rockchip/pm-domains.c
+++ b/drivers/pmdomain/rockchip/pm-domains.c
@@ -861,6 +861,16 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
pd->genpd.name = pd->info->name;
else
pd->genpd.name = kbasename(node->full_name);
+
+ /*
+ * power domain's needing a regulator should default to off, since
+ * the regulator state is unknown at probe time. Also the regulator
+ * state cannot be checked, since that usually requires IP needing
+ * (a different) power domain.
+ */
+ if (pd->info->need_regulator)
+ rockchip_pd_power(pd, false);
+
pd->genpd.power_off = rockchip_pd_power_off;
pd->genpd.power_on = rockchip_pd_power_on;
pd->genpd.attach_dev = rockchip_pd_attach_dev;