Skip to content

Commit 61eeb96

Browse files
shawn1221Ulf Hansson
authored andcommitted
pmdomain: rockchip: Check if SMC could be handled by TA
Non-existent trusted-firmware could lead to SMC calls into some unset location, that breaks the system. Let's check that it's supported before executing the SMC. Reported-by: Steven Price <steven.price@arm.com> Suggested-by: Heiko Stuebner <heiko@sntech.de> Fixes: 58ebba3 ("pmdomain: rockchip: Add smc call to inform firmware") Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Steven Price <steven.price@arm.com> Link: https://lore.kernel.org/r/1739926689-151827-1-git-send-email-shawn.lin@rock-chips.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 58ebba3 commit 61eeb96

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/pmdomain/rockchip/pm-domains.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,10 @@ static void rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd,
572572
}
573573

574574
/* Inform firmware to keep this pd on or off */
575-
arm_smccc_smc(ROCKCHIP_SIP_SUSPEND_MODE, ROCKCHIP_SLEEP_PD_CONFIG,
576-
pmu->info->pwr_offset + pd_pwr_offset,
577-
pd->info->pwr_mask, on, 0, 0, 0, &res);
575+
if (arm_smccc_1_1_get_conduit() != SMCCC_CONDUIT_NONE)
576+
arm_smccc_smc(ROCKCHIP_SIP_SUSPEND_MODE, ROCKCHIP_SLEEP_PD_CONFIG,
577+
pmu->info->pwr_offset + pd_pwr_offset,
578+
pd->info->pwr_mask, on, 0, 0, 0, &res);
578579
}
579580

580581
static int rockchip_pd_power(struct rockchip_pm_domain *pd, bool power_on)

0 commit comments

Comments
 (0)