summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-10-17 15:23:39 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-10-18 19:22:53 -0500
commit4bd4707d19e0ec689da011547a6a2489612fe772 (patch)
tree8658bbb946a6fb670a53e54f526457ed46708495 /core
parent07396870a8d8ad479c973417dd992cd6cd12a999 (diff)
downloadblackbird-skiboot-4bd4707d19e0ec689da011547a6a2489612fe772.tar.gz
blackbird-skiboot-4bd4707d19e0ec689da011547a6a2489612fe772.zip
core/direct-controls: increase special wakeup timeout on POWER9
Some instances have been observed where the special wakeup assert times out. The current timeout is too short for deeper sleep states. Hostboot uses 100ms, so match that. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Acked-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/direct-controls.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/direct-controls.c b/core/direct-controls.c
index 9acdab5e..c6834d77 100644
--- a/core/direct-controls.c
+++ b/core/direct-controls.c
@@ -36,7 +36,10 @@
#define P9_EC_PPM_SSHHYP 0x0114
#define P9_SPECIAL_WKUP_DONE PPC_BIT(1)
-#define P9_SPWKUP_TIMEOUT 10
+
+/* Waking may take up to 5ms for deepest sleep states. Set timeout to 100ms */
+#define P9_SPWKUP_POLL_INTERVAL 100
+#define P9_SPWKUP_TIMEOUT 100000
/*
* This implements direct control facilities of processor cores and threads
@@ -62,7 +65,7 @@ static int p9_core_set_special_wakeup(struct cpu_thread *cpu)
return OPAL_HARDWARE;
}
- for (i = 0; i < P9_SPWKUP_TIMEOUT; i++) {
+ for (i = 0; i < P9_SPWKUP_TIMEOUT/P9_SPWKUP_POLL_INTERVAL; i++) {
if (xscom_read(chip_id, sshhyp_addr, &val)) {
prlog(PR_ERR, "Could not set special wakeup on %u:%u:"
" Unable to read PPM_SSHHYP.\n",
@@ -72,7 +75,7 @@ static int p9_core_set_special_wakeup(struct cpu_thread *cpu)
if (val & P9_SPECIAL_WKUP_DONE)
return 0;
- time_wait_us(1);
+ time_wait_us(P9_SPWKUP_POLL_INTERVAL);
}
prlog(PR_ERR, "Could not set special wakeup on %u:%u:"
OpenPOWER on IntegriCloud