diff options
author | Randall Spangler <rspangler@chromium.org> | 2014-02-04 13:10:25 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-03-28 21:01:11 +0000 |
commit | 3c90074ecd213ff8dde9dbf9885666cd27dc6ae4 (patch) | |
tree | e42e8bc1e2fef8c4485fbadca4baf366d1f7dc4b | |
parent | 797747ce98eeeb8dd9ac7f8848264311aae6b8fb (diff) | |
download | chrome-ec-3c90074ecd213ff8dde9dbf9885666cd27dc6ae4.tar.gz |
Stop hang detect timer when flags are set to 0
Previously, setting flags=0 would disable any future timers from being
started, but not stop any timer currently in progress. With this
change, it does.
BUG=chromium:298983
BRANCH=rambi,nyan
TEST=manual
on ap, ectool hangdetect 1 60000 0
on ec, hangdet -> status=inactive
press power button
on ec, hangdet -> status=active for event
on ap, ectool hangdetect 0 0 0
on ec, hangdet -> status=inactive
Change-Id: Ied3dd4f8a49b9d6a5968837fd859fca7c7b128ba
Original-Change-Id: Icf8c6e0e95ae3780d250f9f01ec6a4dda6c56176
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184950
Reviewed-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192147
Commit-Queue: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
-rw-r--r-- | common/ap_hang_detect.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/ap_hang_detect.c b/common/ap_hang_detect.c index f19f0b7e60..502dbd620c 100644 --- a/common/ap_hang_detect.c +++ b/common/ap_hang_detect.c @@ -177,6 +177,10 @@ static int hang_detect_host_command(struct host_cmd_handler_args *args) return EC_RES_SUCCESS; } + /* If hang detect transitioning to disabled, stop timers */ + if (hdparams.flags && !p->flags) + hang_detect_stop("ap flags=0"); + /* Save new params */ hdparams = *p; CPRINTF("[%T hang detect flags=0x%x, event=%d ms, reboot=%d ms]\n", |