summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorLeonard Crestez <leonard.crestez@nxp.com>2018-08-31 15:49:36 +0300
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:33:40 +0800
commit268e65dfe14e813aae3c69231a91cc8353f370da (patch)
tree39751272dbe365ba46d770843af548f5f70201da /drivers/soc
parent5ca95ddee63a0b4bc8a804973f4229edf83b178e (diff)
MLK-19435 soc: imx8: pm-domains: Report failures to pm core
Right now power_on always returns true even if SCFW reports a failure. Since the target resource is still unpowered this quickly turns into a hang when we attempt to access it. Handle this by reporting an error to the PM core instead and also print the sc_err number to help with debugging. This fixes boot on 8qm A0: instead of hanging on boot we print an error and refuse to probe the VPU. Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Dong Aisheng <Aisheng.dong@nxp.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/imx/pm-domains.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/soc/imx/pm-domains.c b/drivers/soc/imx/pm-domains.c
index bcb363200b3c..a3910ca35ae0 100644
--- a/drivers/soc/imx/pm-domains.c
+++ b/drivers/soc/imx/pm-domains.c
@@ -84,8 +84,11 @@ static int imx8_pd_power(struct generic_pm_domain *domain, bool power_on)
sci_err = sc_pm_set_resource_power_mode(pm_ipc_handle, pd->rsrc_id,
(power_on) ? SC_PM_PW_MODE_ON :
pd->pd.state_idx ? SC_PM_PW_MODE_OFF : SC_PM_PW_MODE_LP);
- if (sci_err)
- pr_err("Failed power operation on resource %d\n", pd->rsrc_id);
+ if (sci_err) {
+ pr_err("Failed power operation on resource %d sc_err %d\n",
+ pd->rsrc_id, sci_err);
+ return -EINVAL;
+ }
return 0;
}
@@ -99,6 +102,8 @@ static int imx8_pd_power_on(struct generic_pm_domain *domain)
pd = container_of(domain, struct imx8_pm_domain, pd);
ret = imx8_pd_power(domain, true);
+ if (ret)
+ return ret;
if (!list_empty(&pd->clks) && (pd->pd.state_idx == PD_OFF)) {
@@ -172,7 +177,7 @@ static int imx8_pd_power_on(struct generic_pm_domain *domain)
}
}
- return ret;
+ return 0;
}
static int imx8_pd_power_off(struct generic_pm_domain *domain)