Commit 59122563 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/wrsw_hal: retry when rts_get_state fails

Sometimes it happens at boot that rts_get_state fails. It may be due to race
condition with ppsi or something else. Anyway try again when rts_get_state
fails.
Additionally print message when got timeout from tmo_expired.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent c0e1e056
......@@ -76,12 +76,19 @@ int hal_init_timing()
/*ups... something went wrong, try again */
rts_set_mode(RTS_MODE_GM_EXTERNAL);
tmo_init(&lock_tmo, LOCK_TIMEOUT_EXT, 0);
} else
} else {
pr_error("Got timeout\n");
return -1;
}
}
if (rts_get_state(&pstate) < 0)
return -1;
if (rts_get_state(&pstate) < 0) {
/* Don't give up when rts_get_state fails, it may be
* due to race with ppsi at boot. No problems seen
* because of waiting here. */
pr_error("rts_get_state failed try again\n");
continue;
}
if (pstate.flags & RTS_DMTD_LOCKED)
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment