summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2014-02-04 13:10:25 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-02-05 03:21:16 +0000
commit7c588a329203987af1f959d49683574a839f0a0f (patch)
tree6760ace1368055872b085f5d82c49255ba6fec24
parent8084d57c89783cef23a751acb3f873ed320b7dc9 (diff)
downloadchrome-ec-7c588a329203987af1f959d49683574a839f0a0f.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: 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>
-rw-r--r--common/ap_hang_detect.c4
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",