[Skiboot] [PATCH] opal/hmi: Fix the soft lockup issue on HMI for certain TB errors.

Mahesh J Salgaonkar mahesh at linux.vnet.ibm.com
Mon Oct 5 21:10:14 AEDT 2015

From: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>

Introduce volatile specifier in wait_for_subcore_threads() to force
re-read the fresh value from the memory. Without this, the compiler
optimizes the while loop not to re-fetch the data from memory pointed by
this_cpu()->core_hmi_state_ptr. This cause CPU to spin infinitely
even though the other CPUs have modified the data causing soft lockup in

Signed-off-by: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
 core/hmi.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/hmi.c b/core/hmi.c
index ee556fc..2d1ac6f 100644
--- a/core/hmi.c
+++ b/core/hmi.c
@@ -448,7 +448,9 @@ static int decode_malfunction(struct OpalHMIEvent *hmi_evt)
 static void wait_for_subcore_threads(void)
-	while (!(*(this_cpu()->core_hmi_state_ptr) & HMI_STATE_CLEANUP_DONE))
+	volatile uint32_t *core_hmi_state_ptr = this_cpu()->core_hmi_state_ptr;
+	while (!(*(core_hmi_state_ptr) & HMI_STATE_CLEANUP_DONE))

More information about the Skiboot mailing list