Skip to content

Commit 695a48b

Browse files
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 <[email protected]>
1 parent 344e5e8 commit 695a48b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/psci/aarch32/psci_helpers.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
2+
* Copyright (c) 2016-2023, ARM Limited and Contributors. All rights reserved.
33
*
44
* SPDX-License-Identifier: BSD-3-Clause
55
*/
@@ -143,6 +143,7 @@ endfunc do_stack_maintenance
143143
*/
144144
func psci_power_down_wfi
145145
dsb sy // ensure write buffer empty
146+
1:
146147
wfi
147-
no_ret plat_panic_handler
148+
b 1b
148149
endfunc psci_power_down_wfi

lib/psci/aarch64/psci_helpers.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved.
2+
* Copyright (c) 2014-2023, ARM Limited and Contributors. All rights reserved.
33
*
44
* SPDX-License-Identifier: BSD-3-Clause
55
*/
@@ -125,6 +125,7 @@ endfunc psci_do_pwrup_cache_maintenance
125125
*/
126126
func psci_power_down_wfi
127127
dsb sy // ensure write buffer empty
128+
1:
128129
wfi
129-
no_ret plat_panic_handler
130+
b 1b
130131
endfunc psci_power_down_wfi

0 commit comments

Comments
 (0)