aboutsummaryrefslogtreecommitdiff
path: root/core/hmi.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-05-22 15:53:02 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-06 20:49:06 +1000
commit05b8834b5a4ff9bd14548594700d354bc4486c5c (patch)
treebd6c90151fada7ab78a0dc1be3ffcbe319ca94d9 /core/hmi.c
parentdb9c1422002c1333fd09177d32edb8c2003fb4ea (diff)
downloadskiboot-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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/hmi.c b/core/hmi.c
index e55a85b..06d8347 100644
--- a/core/hmi.c
+++ b/core/hmi.c
@@ -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();
}
/*