summaryrefslogtreecommitdiff
path: root/common/button.c
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2020-08-12 21:22:44 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-14 19:15:39 +0000
commitc34f2385f86e31a7ea078b3590d85c5a288073e5 (patch)
treec996b1cf46ebfd2aab748e2e3dd04af8e1603518 /common/button.c
parent2debc2805c7ca8acd48540b3fdd49c90df06c13d (diff)
downloadchrome-ec-c34f2385f86e31a7ea078b3590d85c5a288073e5.tar.gz
sysrq: Ignore H1_EC_RECOVERY_BTN_ODL
On Puff, there are two signals from the recovery button. One is from the button and the other is from H1. The signal from H1 is masked by the power button and it looks asserted only after the power button is released. This makes the EC start the warm reset timer. If the user doesn't release the recovery button (as instructed) to enter the recovery mode for four seconds, the AP resets and entry to the recovery mode fails. This patch makes the EC ignore H1's signal as sysrq signal. BUG=b:163443447 BRANCH=Puff TEST=Recovery mode can be entered by keeping recovery button pressed on Duffy. TEST=Recovery button triggers sysrq. TEST=Holding recovery button for 4 seconds triggers AP reset. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I8631d5dc0da8c95eed1d740b0683aa5de7848335 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2353890 Reviewed-by: Andrew McRae <amcrae@chromium.org> Reviewed-by: Sam McNally <sammc@chromium.org>
Diffstat (limited to 'common/button.c')
-rw-r--r--common/button.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/common/button.c b/common/button.c
index 14c63e1ff7..46971321cf 100644
--- a/common/button.c
+++ b/common/button.c
@@ -290,7 +290,16 @@ static void button_change_deferred(void)
* mode so that button change processing is not
* delayed.
*/
- hook_call_deferred(&debug_mode_handle_data, 0);
+#ifdef CONFIG_DEDICATED_RECOVERY_BUTTON
+ /*
+ * Only the direct signal is used for sysrq.
+ * H1_EC_RECOVERY_BTN_ODL doesn't reflect the
+ * true state of the recovery button.
+ */
+ if (i == BUTTON_RECOVERY)
+#endif
+ hook_call_deferred(
+ &debug_mode_handle_data, 0);
#endif
CPRINTS("Button '%s' was %s",
buttons[i].name, new_pressed ?