diff --git a/include/lib/psci/psci.h b/include/lib/psci/psci.h index f12a4d62c..8ea4c277f 100644 --- a/include/lib/psci/psci.h +++ b/include/lib/psci/psci.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2019, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved. * Copyright (c) 2023, NVIDIA Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -376,7 +376,7 @@ int psci_features(unsigned int psci_fid); #if PSCI_OS_INIT_MODE int psci_set_suspend_mode(unsigned int mode); #endif -void __dead2 psci_power_down_wfi(void); +void psci_power_down_wfi(void); void psci_arch_setup(void); #endif /*__ASSEMBLER__*/ diff --git a/plat/allwinner/common/sunxi_native_pm.c b/plat/allwinner/common/sunxi_native_pm.c index 148f50e2a..558b0bb0f 100644 --- a/plat/allwinner/common/sunxi_native_pm.c +++ b/plat/allwinner/common/sunxi_native_pm.c @@ -49,6 +49,8 @@ static void __dead2 sunxi_system_off(void) sunxi_cpu_power_off_others(); sunxi_cpu_power_off_self(); psci_power_down_wfi(); + /* should never reach here */ + panic(); } static void __dead2 sunxi_system_reset(void) diff --git a/plat/allwinner/common/sunxi_scpi_pm.c b/plat/allwinner/common/sunxi_scpi_pm.c index 6a0e96701..8870a71d9 100644 --- a/plat/allwinner/common/sunxi_scpi_pm.c +++ b/plat/allwinner/common/sunxi_scpi_pm.c @@ -108,6 +108,8 @@ static void __dead2 sunxi_system_off(void) } psci_power_down_wfi(); + /* should never reach here */ + panic(); } static void __dead2 sunxi_system_reset(void) @@ -123,6 +125,8 @@ static void __dead2 sunxi_system_reset(void) } psci_power_down_wfi(); + /* should never reach here */ + panic(); } static int sunxi_system_reset2(int is_vendor, int reset_type, u_register_t cookie) @@ -142,6 +146,8 @@ static int sunxi_system_reset2(int is_vendor, int reset_type, u_register_t cooki } psci_power_down_wfi(); + /* should never reach here */ + panic(); /* * Should not reach here. diff --git a/plat/mediatek/include/lib/pm/mtk_pm.h b/plat/mediatek/include/lib/pm/mtk_pm.h index 14d005dcd..05293e95d 100644 --- a/plat/mediatek/include/lib/pm/mtk_pm.h +++ b/plat/mediatek/include/lib/pm/mtk_pm.h @@ -78,7 +78,7 @@ struct plat_pm_pwr_ctrl { psci_power_state_t *req_state); void (*get_sys_suspend_power_state)( psci_power_state_t *req_state); - __dead2 void (*pwr_domain_pwr_down_wfi)( + void (*pwr_domain_pwr_down_wfi)( const psci_power_state_t *req_state); }; diff --git a/plat/mediatek/lib/pm/armv9_0/pwr_ctrl.c b/plat/mediatek/lib/pm/armv9_0/pwr_ctrl.c index 73b1f6855..fbaa3f437 100644 --- a/plat/mediatek/lib/pm/armv9_0/pwr_ctrl.c +++ b/plat/mediatek/lib/pm/armv9_0/pwr_ctrl.c @@ -371,7 +371,7 @@ static void get_sys_suspend_power_state(psci_power_state_t *req_state) } #endif -static void __dead2 pwr_domain_pwr_down_wfi(const psci_power_state_t *req_state) +static void pwr_domain_pwr_down_wfi(const psci_power_state_t *req_state) { unsigned int cpu = plat_my_core_pos(); int ret = MTK_CPUPM_E_NOT_SUPPORT; @@ -382,6 +382,8 @@ static void __dead2 pwr_domain_pwr_down_wfi(const psci_power_state_t *req_state) plat_panic_handler(); else psci_power_down_wfi(); + /* should never reach here */ + panic(); } static void pm_smp_init(unsigned int cpu_id, uintptr_t entry_point) diff --git a/plat/qti/common/src/qti_pm.c b/plat/qti/common/src/qti_pm.c index 1113efcfa..4400e40ea 100644 --- a/plat/qti/common/src/qti_pm.c +++ b/plat/qti/common/src/qti_pm.c @@ -217,6 +217,7 @@ __dead2 void qti_domain_power_down_wfi(const psci_power_state_t *target_state) /* For now just do WFI - add any target specific handling if needed */ psci_power_down_wfi(); /* We should never reach here */ + panic(); } static __dead2 void assert_ps_hold(void) diff --git a/plat/rockchip/common/plat_pm.c b/plat/rockchip/common/plat_pm.c index 69268870d..c3dc23474 100644 --- a/plat/rockchip/common/plat_pm.c +++ b/plat/rockchip/common/plat_pm.c @@ -118,11 +118,15 @@ void __dead2 rockchip_soc_cores_pd_pwr_dn_wfi( 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 0d8e8b689..6200cac07 100644 --- a/plat/rockchip/px30/drivers/pmu/pmu.c +++ b/plat/rockchip/px30/drivers/pmu/pmu.c @@ -1000,6 +1000,8 @@ void __dead2 rockchip_soc_soft_reset(void) * 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 @@ void __dead2 rockchip_soc_system_off(void) * 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 597db978f..41660e2c0 100644 --- a/plat/rockchip/rk3328/drivers/pmu/pmu.c +++ b/plat/rockchip/rk3328/drivers/pmu/pmu.c @@ -619,6 +619,8 @@ void __dead2 rockchip_soc_sys_pd_pwr_dn_wfi(void) /* 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 a4128b214..16436dd13 100644 --- a/plat/rockchip/rk3588/drivers/pmu/pmu.c +++ b/plat/rockchip/rk3588/drivers/pmu/pmu.c @@ -1319,12 +1319,16 @@ void __dead2 rockchip_soc_cores_pd_pwr_dn_wfi(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) { 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 @@ void __dead2 rockchip_soc_soft_reset(void) * 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 @@ void __dead2 rockchip_soc_system_off(void) * 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)