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 29d25d807c ("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
This commit is contained in:
Douglas Anderson
2016-02-17 12:34:03 -08:00
committed by chrome-bot
parent 5c184565af
commit 2fa3138abe
4 changed files with 0 additions and 25 deletions

View File

@@ -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);

View File

@@ -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

View File

@@ -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) {

View File

@@ -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