From 9332d769e9e68be06fc85a9b0170ed3a2d549ee9 Mon Sep 17 00:00:00 2001 From: Sameer Nanda Date: Mon, 24 Sep 2012 12:43:38 -0700 Subject: [PATCH] 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 Change-Id: Ida08bf10c593c75186f472721992a52015e4bf24 Signed-off-by: Sameer Nanda Reviewed-on: https://gerrit.chromium.org/gerrit/33916 Reviewed-by: Vincent Palatin Reviewed-by: David Hendricks --- chip/stm32/keyboard_scan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chip/stm32/keyboard_scan.c b/chip/stm32/keyboard_scan.c index 153c976c10..47e3dac039 100644 --- a/chip/stm32/keyboard_scan.c +++ b/chip/stm32/keyboard_scan.c @@ -316,8 +316,11 @@ static int check_keys_changed(void) CPUTS("]\n"); if (num_press == 3) { - if (check_warm_reboot_keys()) + if (check_warm_reboot_keys()) { + keyboard_clear_state(); system_warm_reboot(); + return 0; + } } if (kb_fifo_add(raw_state) == EC_SUCCESS)