summaryrefslogtreecommitdiff
path: root/drivers/soc/imx/pm-domains.c
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2020-03-09 13:43:18 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2020-03-09 13:43:18 +0100
commit9a14a1f6284c0a5d3bbbb4ccfea8b6959ca63d83 (patch)
tree5c8e9c1cc4365cee43e407eb72871d5ba4b08357 /drivers/soc/imx/pm-domains.c
parentdc6fa31dd7b294f586a07d5929ae3765ddbf86f3 (diff)
parentcd7c926fa65431a20a044f55dbd7609beaffbe46 (diff)
Merge remote-tracking branch 'fslc/4.14-2.3.x-imx' into toradex_4.14-2.3.x-imx
Conflicts: arch/arm64/boot/dts/freescale/Makefile arch/arm64/boot/dts/freescale/fsl-imx8qm-device.dtsi
Diffstat (limited to 'drivers/soc/imx/pm-domains.c')
-rw-r--r--drivers/soc/imx/pm-domains.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/soc/imx/pm-domains.c b/drivers/soc/imx/pm-domains.c
index f75854a42054..c762accaace9 100644
--- a/drivers/soc/imx/pm-domains.c
+++ b/drivers/soc/imx/pm-domains.c
@@ -126,9 +126,10 @@ static int imx8_pd_power(struct generic_pm_domain *domain, bool power_on)
*/
while (!list_empty(&cur_domain->slave_links)) {
struct gpd_link *link;
-
pd = container_of(cur_domain, struct imx8_pm_domain, pd);
- if ((cur_domain == domain) || (!cur_domain->device_count)) {
+ if ((cur_domain == domain) ||
+ ((!cur_domain->device_count) &&
+ (atomic_read(&cur_domain->sd_count) <= 1))) {
sci_err = sc_pm_set_resource_power_mode(pm_ipc_handle,
pd->rsrc_id,
(pd_state) ? SC_PM_PW_MODE_OFF : SC_PM_PW_MODE_LP);
@@ -137,7 +138,8 @@ static int imx8_pd_power(struct generic_pm_domain *domain, bool power_on)
pd->rsrc_id, sci_err);
return -EINVAL;
}
- }
+ } else
+ break;
list_for_each_entry(link, &cur_domain->slave_links, slave_node)
master = link->master;
@@ -147,7 +149,9 @@ static int imx8_pd_power(struct generic_pm_domain *domain, bool power_on)
/* Fix the state for the top parent or a node that has no slave domains */
pd = container_of(cur_domain, struct imx8_pm_domain, pd);
if ((cur_domain == domain) ||
- ((pd->rsrc_id != SC_R_NONE) && (!cur_domain->device_count))) {
+ ((pd->rsrc_id != SC_R_NONE) &&
+ (!cur_domain->device_count) &&
+ (atomic_read(&cur_domain->sd_count) <= 1))) {
sci_err = sc_pm_set_resource_power_mode(pm_ipc_handle,
pd->rsrc_id,
(pd_state) ? SC_PM_PW_MODE_OFF : SC_PM_PW_MODE_LP);