diff options
author | Sameer Nanda <snanda@chromium.org> | 2012-09-24 12:43:38 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2012-10-29 14:47:56 -0700 |
commit | 324332320cd98ae36a342133ff2cc2960f54278c (patch) | |
tree | 18870131ca84b3fe172f51b6336df584d2ad3dcb | |
parent | 528dd30b72a4a6ca9d7e574fead365f0262256d8 (diff) | |
download | chrome-ec-324332320cd98ae36a342133ff2cc2960f54278c.tar.gz |
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 <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33916
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
(cherry picked from commit 9332d769e9e68be06fc85a9b0170ed3a2d549ee9)
Change-Id: I70a22505296164cfa1c2a892873438bab62a78cc
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36082
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
-rw-r--r-- | chip/stm32/keyboard_scan.c | 4 |
1 files changed, 3 insertions, 1 deletions
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. */ |