Skip to content

Commit 861d21c

Browse files
Frank Zhangstorulf
authored andcommitted
pmdomain:rockchip: Fix init genpd as GENPD_STATE_ON before regulator ready
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: db6df2e ("pmdomain: rockchip: add regulator support") Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 3de4996 commit 861d21c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/pmdomain/rockchip/pm-domains.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,16 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
879879
pd->genpd.name = pd->info->name;
880880
else
881881
pd->genpd.name = kbasename(node->full_name);
882+
883+
/*
884+
* power domain's needing a regulator should default to off, since
885+
* the regulator state is unknown at probe time. Also the regulator
886+
* state cannot be checked, since that usually requires IP needing
887+
* (a different) power domain.
888+
*/
889+
if (pd->info->need_regulator)
890+
rockchip_pd_power(pd, false);
891+
882892
pd->genpd.power_off = rockchip_pd_power_off;
883893
pd->genpd.power_on = rockchip_pd_power_on;
884894
pd->genpd.attach_dev = rockchip_pd_attach_dev;

0 commit comments

Comments
 (0)