diff options
author | Mathew King <mathewk@chromium.org> | 2020-01-23 18:05:43 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-10 22:20:27 +0000 |
commit | 085ab4d4603f7c1fd402adae6a8f10e8b569df81 (patch) | |
tree | 748f9fed43e6011db2cadd9071bb0e8df2767a18 | |
parent | 1411a256089ad45a99a2e327972bc6f732f5a6e9 (diff) | |
download | chrome-ec-085ab4d4603f7c1fd402adae6a8f10e8b569df81.tar.gz |
cr50: Defer call to board_reboot_ec() in key_combo0_irq()
On Wilco devices the recovery key combination will trigger an irq which
will reboot the EC to enter recovery mode. CL:1881752 moved a 30 ms
delay and made it synchronous. This change works in most contexts except
for within an irq which cannot sleep so when a user presses the recovery
key combo the H1 will hard reboot when the sleep is called. This change
defers the call to board_reboot_ec() so that it is no longer in the irq
context.
BUG=b:147404780
TEST=On Drallion and Sarien press pwr + F2, recovery mode is entered
without to hold the keys for an extended period of time. Also
verified that programming flash over CCD still works on Drallion.
BRANCH=none
Change-Id: Ib7ebbe2c67b575b6a99d01a4055bb00ee9d15b7e
Signed-off-by: Mathew King <mathewk@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2020328
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Tested-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | board/cr50/board.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index 4927194b74..c837e11630 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -1064,6 +1064,7 @@ void board_reboot_ec(void) assert_ec_rst(); deassert_ec_rst(); } +DECLARE_DEFERRED(board_reboot_ec); /* * This interrupt handler will be called if the RBOX key combo is detected. @@ -1072,7 +1073,7 @@ static void key_combo0_irq(void) { GWRITE_FIELD(RBOX, INT_STATE, INTR_BUTTON_COMBO0_RDY, 1); recovery_button_record(); - board_reboot_ec(); + hook_call_deferred(&board_reboot_ec_data, 0); CPRINTS("Recovery Requested"); } DECLARE_IRQ(GC_IRQNUM_RBOX0_INTR_BUTTON_COMBO0_RDY_INT, key_combo0_irq, 0); |