From 7c588a329203987af1f959d49683574a839f0a0f Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Tue, 4 Feb 2014 13:10:25 -0800 Subject: 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: Icf8c6e0e95ae3780d250f9f01ec6a4dda6c56176 Signed-off-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/184950 Reviewed-by: Daniel Erat Reviewed-by: Alec Berg --- common/ap_hang_detect.c | 4 ++++ 1 file changed, 4 insertions(+) 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", -- cgit v1.2.1