From ac653837834c3647097eb6ba8a2ed3f8244aa322 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 30 May 2018 09:48:34 +0800 Subject: [PATCH] MLK-18435-2 power: imx8: remove the resource owned check before poewr off For all the devices used and set ACTIVE in U-Boot, U-Boot needs to power off all of them without the check of resource owner. When we create software partition before booting Linux, the resource own checkw will return false, and cause the power domain not powered off. If without the check of resource owner, the power domain in the other software partition could be powered off with parent partition could access child partition resources. Signed-off-by: Peng Fan (cherry picked from commit 3e29e8adace18035850be9d56cc277c64a221e85) (cherry picked from commit 81e64d882c2904f5aa38121d020f6e21e142aaf8) --- drivers/power/domain/imx8-power-domain.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/power/domain/imx8-power-domain.c b/drivers/power/domain/imx8-power-domain.c index d51dbaa6c0..bce38d572f 100644 --- a/drivers/power/domain/imx8-power-domain.c +++ b/drivers/power/domain/imx8-power-domain.c @@ -108,13 +108,13 @@ static int imx8_power_domain_off_node(struct power_domain *power_domain) } if (pdata->resource_id != SC_R_LAST) { - if (!sc_rm_is_resource_owned(-1, pdata->resource_id)) { - printf("%s not owned by curr partition\n", dev->name); - return 0; - } ret = sc_pm_set_resource_power_mode(-1, pdata->resource_id, SC_PM_PW_MODE_OFF); if (ret) { + if (!sc_rm_is_resource_owned(-1, pdata->resource_id)) { + printf("%s not owned by curr partition %d\n", dev->name, pdata->resource_id); + return 0; + } printf("Error: %s Power off failed! (error = %d)\n", dev->name, ret); return -EIO; -- 2.17.1