diff options
author | Douglas Anderson <dianders@chromium.org> | 2016-02-17 12:34:03 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-02-18 13:29:36 -0800 |
commit | 2fa3138abea8d97a21af884d499424b62da02812 (patch) | |
tree | c378105fe08a357722effc6c2cf54fb64b8ccb92 | |
parent | 5c184565afddbec361100b198721a42bb95a7adb (diff) | |
download | chrome-ec-2fa3138abea8d97a21af884d499424b62da02812.tar.gz |
gaia, mediatek, rockchip, tegra: No more disabling key scanning in power files
In http://crosreview.com/28402 code was added to power/gaia.c that
disabled keyboard scanning if the power button was pressed. The
purpose, according to that change, was to prevent accidental reboots by
pressing the power button together with another key that wasn't the
"Refresh" key (specifically: LCtrl, Tab, Reload, t, [, ], y, Dim Screen
and Mute).
At the time the original code was added, there was already code in the
power button interrupt handler to accomplish the same purpose: see
commit 29d25d807c18 ("Keyboard scan must stop driving columns when power
button is pressed."). It's unclear if the code in the interrupt handler
didn't work or if there was some other bug with it. ...or if perhaps
the changes in "gaia/power.c" weren't actually needed and the important
part of the original change was the mutex added to the scanning task.
In any case, current testing indicates that the code in power/gaia.c,
power/rockchip.c, and power/tegra.c isn't needed anymore. I ran through
the test sequence described in the original CL on my veyron_jerry and I
don't see any accidental reboots.
It's also instructive to note that only ARM boards (all presumably
copied from gaia) have this extra code. Presumably if the code was
actually needed then x86 boards would also need it.
In any case, let's remove it. It's suspected that there's some crazy
race where the disable in power/rockchip.c is overriding the enable in
the main power key handling code and leaving the keyboard disabled.
BRANCH=None
BUG=chrome-os-partner:48470
TEST=Same test as CL:28402
Change-Id: I6d21167ce3d773c9616abd4a728247a1934b96d6
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/327843
Reviewed-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit dfae7e7ad45f4ce0e8f820caaa05a8754bba0250)
Reviewed-on: https://chromium-review.googlesource.com/328013
-rw-r--r-- | power/gaia.c | 7 | ||||
-rw-r--r-- | power/mediatek.c | 6 | ||||
-rw-r--r-- | power/rockchip.c | 6 | ||||
-rw-r--r-- | power/tegra.c | 6 |
4 files changed, 0 insertions, 25 deletions
diff --git a/power/gaia.c b/power/gaia.c index 553b01bfcc..161cf14553 100644 --- a/power/gaia.c +++ b/power/gaia.c @@ -199,13 +199,6 @@ static int check_for_power_off_event(void) pressed = 1; } -#ifdef HAS_TASK_KEYSCAN - /* Dis/Enable keyboard scanning when the power button state changes */ - if (!pressed || pressed != power_button_was_pressed) - keyboard_scan_enable(!pressed, KB_SCAN_DISABLE_POWER_BUTTON); -#endif - - now = get_time(); if (pressed) { set_pmic_pwrok(1); diff --git a/power/mediatek.c b/power/mediatek.c index a3817c1a06..544adbe250 100644 --- a/power/mediatek.c +++ b/power/mediatek.c @@ -317,12 +317,6 @@ static int check_for_power_off_event(void) return POWER_OFF_BY_POWER_REQ; } -#ifdef HAS_TASK_KEYSCAN - /* Dis/Enable keyboard scanning when the power button state changes */ - if (!pressed || pressed != power_button_was_pressed) - keyboard_scan_enable(!pressed, KB_SCAN_DISABLE_POWER_BUTTON); -#endif - now = get_time(); if (pressed) { #ifndef CONFIG_PMIC_FW_LONG_PRESS_TIMER diff --git a/power/rockchip.c b/power/rockchip.c index 7a2955af68..b448ad2f3d 100644 --- a/power/rockchip.c +++ b/power/rockchip.c @@ -164,12 +164,6 @@ static int check_for_power_off_event(void) return 4; /* return non-zero for shudown down */ } -#ifdef HAS_TASK_KEYSCAN - /* Dis/Enable keyboard scanning when the power button state changes */ - if (!pressed || pressed != power_button_was_pressed) - keyboard_scan_enable(!pressed, KB_SCAN_DISABLE_POWER_BUTTON); -#endif - now = get_time(); if (pressed) { if (!power_button_was_pressed) { diff --git a/power/tegra.c b/power/tegra.c index 80ae5d9eab..431ccd3da0 100644 --- a/power/tegra.c +++ b/power/tegra.c @@ -183,12 +183,6 @@ static int check_for_power_off_event(void) return 4; /* return non-zero for shudown down */ } -#ifdef HAS_TASK_KEYSCAN - /* Dis/Enable keyboard scanning when the power button state changes */ - if (!pressed || pressed != power_button_was_pressed) - keyboard_scan_enable(!pressed, KB_SCAN_DISABLE_POWER_BUTTON); -#endif - now = get_time(); if (pressed) { #ifndef CONFIG_PMIC_FW_LONG_PRESS_TIMER |