[Pdbg] [PATCH v2 01/10] libpdbg/p9chip.c: update timeouts for special wakeup and stop
Nicholas Piggin
npiggin at gmail.com
Wed May 2 02:33:30 AEST 2018
Update timeouts to 100ms, to match skiboot/core/direct-controls.c.
Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
libpdbg/p9chip.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c
index 380cb59..55c0c1d 100644
--- a/libpdbg/p9chip.c
+++ b/libpdbg/p9chip.c
@@ -65,8 +65,8 @@
#define PPM_SPWKUP_OTR 0xf010a
#define SPECIAL_WKUP_DONE PPC_BIT(1)
-#define RAS_STATUS_TIMEOUT 100
-#define SPECIAL_WKUP_TIMEOUT 10
+#define RAS_STATUS_TIMEOUT 100 /* 100ms */
+#define SPECIAL_WKUP_TIMEOUT 100 /* 100ms */
static uint64_t thread_read(struct thread *thread, uint64_t addr, uint64_t *data)
{
@@ -116,7 +116,8 @@ static int p9_thread_stop(struct thread *thread)
int i = 0;
thread_write(thread, P9_DIRECT_CONTROL, PPC_BIT(7 + 8*thread->id));
- while(!(p9_get_thread_status(thread) & THREAD_STATUS_QUIESCE)) {
+ while (!(p9_get_thread_status(thread) & THREAD_STATUS_QUIESCE)) {
+ usleep(1000);
if (i++ > RAS_STATUS_TIMEOUT) {
PR_ERROR("Unable to quiesce thread\n");
break;
@@ -318,7 +319,7 @@ static int p9_core_probe(struct pdbg_target *target)
CHECK_ERR(pib_write(target, PPM_SPWKUP_OTR, PPC_BIT(0)));
do {
- usleep(1);
+ usleep(1000);
CHECK_ERR(pib_read(target, PPM_GPMMR, &value));
if (i++ > SPECIAL_WKUP_TIMEOUT) {
--
2.17.0
More information about the Pdbg
mailing list