refactor: panic after calling psci_power_down_wfi()
This function doesn't return and its callers that don't return either
rely on this. Drop the dead attribute and add a panic() after it to make
this expectation explicit. Calling `wfi` in the powerdown sequence is
terminal so even if the function was made to return, there would be no
functional change.
This is useful for a following patch that makes psci_power_down_wfi()
return.
Change-Id: I62ca1ee058b1eaeb046966c795081e01bf45a2eb
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
diff --git a/plat/rockchip/common/plat_pm.c b/plat/rockchip/common/plat_pm.c
index 6926887..c3dc234 100644
--- a/plat/rockchip/common/plat_pm.c
+++ b/plat/rockchip/common/plat_pm.c
@@ -118,11 +118,15 @@
const psci_power_state_t *target_state)
{
psci_power_down_wfi();
+ /* should never reach here */
+ panic();
}
void __dead2 rockchip_soc_sys_pd_pwr_dn_wfi(void)
{
psci_power_down_wfi();
+ /* should never reach here */
+ panic();
}
/*******************************************************************************
diff --git a/plat/rockchip/px30/drivers/pmu/pmu.c b/plat/rockchip/px30/drivers/pmu/pmu.c
index 0d8e8b6..6200cac 100644
--- a/plat/rockchip/px30/drivers/pmu/pmu.c
+++ b/plat/rockchip/px30/drivers/pmu/pmu.c
@@ -1000,6 +1000,8 @@
* so we do not hope the core to execute valid codes.
*/
psci_power_down_wfi();
+ /* should never reach here */
+ panic();
}
void __dead2 rockchip_soc_system_off(void)
@@ -1025,6 +1027,8 @@
* so we do not hope the core to execute valid codes.
*/
psci_power_down_wfi();
+ /* should never reach here */
+ panic();
}
void rockchip_plat_mmu_el3(void)
diff --git a/plat/rockchip/rk3328/drivers/pmu/pmu.c b/plat/rockchip/rk3328/drivers/pmu/pmu.c
index 597db97..41660e2 100644
--- a/plat/rockchip/rk3328/drivers/pmu/pmu.c
+++ b/plat/rockchip/rk3328/drivers/pmu/pmu.c
@@ -619,6 +619,8 @@
/* should never reach here */
psci_power_down_wfi();
+ /* should never reach here */
+ panic();
}
int rockchip_soc_sys_pwr_dm_suspend(void)
diff --git a/plat/rockchip/rk3588/drivers/pmu/pmu.c b/plat/rockchip/rk3588/drivers/pmu/pmu.c
index a4128b2..16436dd 100644
--- a/plat/rockchip/rk3588/drivers/pmu/pmu.c
+++ b/plat/rockchip/rk3588/drivers/pmu/pmu.c
@@ -1319,12 +1319,16 @@
psci_power_state_t *target_state)
{
psci_power_down_wfi();
+ /* should never reach here */
+ panic();
}
void __dead2 rockchip_soc_sys_pd_pwr_dn_wfi(void)
{
cpus_pd_req_enter_wfi();
psci_power_down_wfi();
+ /* should never reach here */
+ panic();
}
void __dead2 rockchip_soc_soft_reset(void)
@@ -1352,6 +1356,8 @@
* so we do not hope the core to execute valid codes.
*/
psci_power_down_wfi();
+ /* should never reach here */
+ panic();
}
void __dead2 rockchip_soc_system_off(void)
@@ -1373,6 +1379,8 @@
* so we do not hope the core to execute valid codes.
*/
psci_power_down_wfi();
+ /* should never reach here */
+ panic();
}
static void rockchip_pmu_pd_init(void)