diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-05-22 15:53:02 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-06-06 20:49:06 +1000 |
commit | 05b8834b5a4ff9bd14548594700d354bc4486c5c (patch) | |
tree | bd6c90151fada7ab78a0dc1be3ffcbe319ca94d9 /core/hmi.c | |
parent | db9c1422002c1333fd09177d32edb8c2003fb4ea (diff) | |
download | skiboot-05b8834b5a4ff9bd14548594700d354bc4486c5c.zip skiboot-05b8834b5a4ff9bd14548594700d354bc4486c5c.tar.gz skiboot-05b8834b5a4ff9bd14548594700d354bc4486c5c.tar.bz2 |
Convert important polling loops to spin at lowest SMT priority
The pattern of calling cpu_relax() inside a polling loop does
not suit the powerpc SMT priority instructions. Prefrred is to
set a low priority then spin until break condition is reached,
then restore priority.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[stewart@linux.vnet.ibm.com: fixup lpc-uart wait_tx_room() and unit test]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/hmi.c')
-rw-r--r-- | core/hmi.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -599,6 +599,7 @@ static void wait_for_subcore_threads(void) { uint64_t timeout = 0; + smt_lowest(); while (!(*(this_cpu()->core_hmi_state_ptr) & HMI_STATE_CLEANUP_DONE)) { /* * We use a fixed number of TIMEOUT_LOOPS rather @@ -616,8 +617,9 @@ static void wait_for_subcore_threads(void) prlog(PR_DEBUG, "HMI: TB pre-recovery timeout\n"); break; } - cpu_relax(); + barrier(); } + smt_medium(); } /* |