From 324332320cd98ae36a342133ff2cc2960f54278c Mon Sep 17 00:00:00 2001 From: Sameer Nanda Date: Mon, 24 Sep 2012 12:43:38 -0700 Subject: Don't forward keys in case of warm reboot sequence match If the key combination matches the warm reboot sequence (alt-volume_up-r), do not forward these keys to the AP. If the keys do get forwarded, the AP's key handler can race with the EC's GAIAPOWER task and unpredicatable things may happen. BUG=chrome-os-partner:14496 TEST=hit alt-volume_up-r keys together. This should cause the system to reboot. If in dev mode, check the contents of /dev/pstore/console_ramoops file -- the contents should be from the previous boot. BRANCH=snow Signed-off-by: Sameer Nanda Reviewed-on: https://gerrit.chromium.org/gerrit/33916 Reviewed-by: Vincent Palatin Reviewed-by: David Hendricks (cherry picked from commit 9332d769e9e68be06fc85a9b0170ed3a2d549ee9) Change-Id: I70a22505296164cfa1c2a892873438bab62a78cc Signed-off-by: Simon Glass Reviewed-on: https://gerrit.chromium.org/gerrit/36082 Reviewed-by: Randall Spangler Reviewed-by: David Hendricks --- chip/stm32/keyboard_scan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chip/stm32/keyboard_scan.c b/chip/stm32/keyboard_scan.c index b119c9f711..500084b8b7 100644 --- a/chip/stm32/keyboard_scan.c +++ b/chip/stm32/keyboard_scan.c @@ -261,8 +261,10 @@ static void check_runtime_keys(const uint8_t *state) if (state[MASK_INDEX_KEYR] == MASK_VALUE_KEYR && state[MASK_INDEX_VOL_UP] == MASK_VALUE_VOL_UP && (state[MASK_INDEX_RIGHT_ALT] == MASK_VALUE_RIGHT_ALT || - state[MASK_INDEX_LEFT_ALT] == MASK_VALUE_LEFT_ALT)) + state[MASK_INDEX_LEFT_ALT] == MASK_VALUE_LEFT_ALT)) { + keyboard_clear_state(); system_warm_reboot(); + } } /* Print the keyboard state. */ -- cgit v1.2.1