mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
change suspend timeout behavior
When suspend fails to happen within the designated time, instead of forcing it, return a failure code so we can retry it again later. In testing, this seems to be a very reasonable approach, because sometimes servers are just too busy to do a suspend, and just waiting a couple seconds until eg some file commits are done makes everything work much better.
This commit is contained in:
parent
9140beef24
commit
9b94033a4a
2 changed files with 6 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "xous-susres"
|
||||
version = "0.1.32"
|
||||
version = "0.1.33"
|
||||
authors = ["bunnie <bunnie@kosagi.com>"]
|
||||
edition = "2018"
|
||||
description = "Manager of suspend/resume operations implementation"
|
||||
|
|
|
|||
|
|
@ -772,6 +772,8 @@ fn main() -> ! {
|
|||
}
|
||||
}
|
||||
}
|
||||
// In case of timeout, skip the suspend cycle and return a failure, instead of forcing the suspend.
|
||||
/*
|
||||
susres_hw.debug_delay(500); // let the messages print
|
||||
// force a suspend
|
||||
susres_hw.do_suspend(true);
|
||||
|
|
@ -780,22 +782,21 @@ fn main() -> ! {
|
|||
// ---- time passes while we are asleep ----
|
||||
// ---- omg power came back! ---
|
||||
|
||||
// when do_suspend() returns, it means we've resumed
|
||||
let sender = suspend_requested.take().expect("suspend was requested, but no requestor is on record!");
|
||||
|
||||
log_server::resume(); // log server is a special case, in order to avoid circular dependencies
|
||||
if susres_hw.do_resume() {
|
||||
log::error!("We forced a suspend, some peripherals may be in an unclean state!");
|
||||
} else {
|
||||
log::error!("We forced a suspend, but the bootloader is claiming we did a clean suspend. Internal state may be inconsistent.");
|
||||
}
|
||||
*/
|
||||
let sender = suspend_requested.take().expect("suspend was requested, but no requestor is on record!");
|
||||
for pid in gated_pids.drain(..) {
|
||||
xous::return_scalar(pid, 0).expect("couldn't return dummy message to unblock execution");
|
||||
}
|
||||
susres_hw.restore_wfi();
|
||||
|
||||
// this unblocks the requestor of the suspend
|
||||
xous::return_scalar(sender, 1).ok();
|
||||
xous::return_scalar(sender, 0).ok();
|
||||
} else {
|
||||
log::trace!("clean suspend timeout received, ignoring");
|
||||
// this means we did a clean suspend, we've resumed, and the timeout came back after the resume
|
||||
|
|
|
|||
Loading…
Reference in a new issue