fix(psci): tighten psci_power_down_wfi behaviour

A processing element should never return from a wfi, however, due to a
hardware bug, certain CPUs may wake up because of an external event.
This patch tightens the behaviour of the common power down sequence, it
ensures the routine never returns by entering a wfi loop at its end. It
aligns with the behaviour of the platform implementations.

Change-Id: I36d8b0c64eccb71035bf164b4cd658d66ed7beb4
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
This commit is contained in:
Harrison Mutai 2023-01-11 17:01:04 +00:00
parent 344e5e8149
commit 695a48b5b4
2 changed files with 6 additions and 4 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016-2023, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -143,6 +143,7 @@ endfunc do_stack_maintenance
*/
func psci_power_down_wfi
dsb sy // ensure write buffer empty
1:
wfi
no_ret plat_panic_handler
b 1b
endfunc psci_power_down_wfi

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2014-2023, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -125,6 +125,7 @@ endfunc psci_do_pwrup_cache_maintenance
*/
func psci_power_down_wfi
dsb sy // ensure write buffer empty
1:
wfi
no_ret plat_panic_handler
b 1b
endfunc psci_power_down_wfi