From 975d076d4aef260fd9adfbabc6339fe05eed21c1 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 23 Jan 2021 00:43:52 -0600 Subject: [PATCH] allwinner: psci: Drop .pwr_domain_pwr_down_wfi callback When operating on the local cpu, sunxi_cpu_power_off_self() only "arms" the ARISC to perform the power-off process; the SCP waits for the CPU to enter WFI before acutally powering it off. Since this matches the expected split between .pwr_domain_off and .pwr_domain_pwr_down_wfi, we can move the sunxi_cpu_power_off_self() call to sunxi_pwr_domain_off(). Since that change makes sunxi_pwr_down_wfi() equivalent to the default implementation, the callback is no longer needed. Change-Id: I7d65f66c550d1c69fa5e9945affd7a25b3d3ef42 Signed-off-by: Samuel Holland --- plat/allwinner/common/sunxi_pm.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/plat/allwinner/common/sunxi_pm.c b/plat/allwinner/common/sunxi_pm.c index 1e1d8959a..e6e913396 100644 --- a/plat/allwinner/common/sunxi_pm.c +++ b/plat/allwinner/common/sunxi_pm.c @@ -102,17 +102,11 @@ static void sunxi_pwr_domain_off(const psci_power_state_t *target_state) scpi_map_state(cpu_pwr_state), scpi_map_state(cluster_pwr_state), scpi_map_state(system_pwr_state)); + } else { + sunxi_cpu_power_off_self(); } } -static void __dead2 sunxi_pwr_down_wfi(const psci_power_state_t *target_state) -{ - sunxi_cpu_power_off_self(); - - while (1) - wfi(); -} - static void sunxi_pwr_domain_on_finish(const psci_power_state_t *target_state) { if (is_local_state_off(SYSTEM_PWR_STATE(target_state))) @@ -270,9 +264,6 @@ int plat_setup_psci_ops(uintptr_t sec_entrypoint, sunxi_psci_ops.pwr_domain_suspend = sunxi_pwr_domain_off; sunxi_psci_ops.pwr_domain_suspend_finish = sunxi_pwr_domain_on_finish; sunxi_psci_ops.get_sys_suspend_power_state = sunxi_get_sys_suspend_power_state; - } else { - /* This is only needed when SCPI is unavailable. */ - sunxi_psci_ops.pwr_domain_pwr_down_wfi = sunxi_pwr_down_wfi; } *psci_ops = &sunxi_psci_ops;