From 873c9f46ee03060093efbb169d5fd454dfabed4e Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Wed, 9 Oct 2013 16:05:24 -0700 Subject: CHERRY-PICK: Fix bug with hibernate delay when running off battery Fixes hibernate delay logic for chipset x86. With this change the machine will go in to hibernate one hour after going into G3 when running off battery. BUG=chrome-os-partner:23224 BRANCH=none TEST=Used console command hibdelay to set a reasonable hibernate delay time and tested all combinations of running off battery vs. AC and shutting off before or after the machine has been on for a hibdelay amount of time. Change-Id: Icfb118fdc737ad53db60bb1bb96fc51c95b8bbdc Original-Change-Id: Idd94d3677669dcd405732195b8cbbc1edca1e171 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/172512 Reviewed-by: Vincent Palatin Reviewed-by: Bill Richardson Reviewed-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/174792 Commit-Queue: Dave Parker Tested-by: Dave Parker --- common/chipset_x86_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/chipset_x86_common.c b/common/chipset_x86_common.c index 63fecfdda9..2704dd143c 100644 --- a/common/chipset_x86_common.c +++ b/common/chipset_x86_common.c @@ -122,7 +122,7 @@ int x86_wait_signals(uint32_t want) void x86_set_state(enum x86_state new_state) { /* Record the time we go into G3 */ - if (state == X86_G3) + if (new_state == X86_G3) last_shutdown_time = get_time().val; state = new_state; -- cgit v1.2.1