summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2018-08-24 16:58:58 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-08-29 06:27:18 -0700
commite10e1af4d5cc2796b02cfe9e56c8d7eb7b822028 (patch)
tree89457e4f39faf2c17f2ec465d09a24450b3b43eb
parentd5e08f7f0db8738b9e802b7029ece3410d22b943 (diff)
downloadchrome-ec-e10e1af4d5cc2796b02cfe9e56c8d7eb7b822028.tar.gz
fingerprint: Flush SPI transaction before increasing CPU clock
It was observed on multiple devices that Fingerprint MCU hangs and WDT reboots MCU on fingerprint enrollment. This patch should fix/mitigate the issue. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:112781659 BRANCH=none TEST=Verify no crash is observed on Nocturne when enrolling a fingerprint. Change-Id: I6eec541650200cd2370e5505947e788f7a5e08b9 Reviewed-on: https://chromium-review.googlesource.com/1192102 Commit-Ready: Nicolas Norvez <norvez@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Nicolas Norvez <norvez@chromium.org>
-rw-r--r--common/fpsensor.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/fpsensor.c b/common/fpsensor.c
index 10e7fb6369..f41f8013bd 100644
--- a/common/fpsensor.c
+++ b/common/fpsensor.c
@@ -183,6 +183,13 @@ static void fp_process_finger(void)
if (!res) {
uint32_t evt = EC_MKBP_FP_IMAGE_READY;
+ /* Clean up SPI before clocking up to avoid hang on the dsb
+ * in dma_go. Ignore the return value to let the WDT reboot
+ * the MCU (and avoid getting trapped in the loop).
+ * b/112781659 */
+ res = spi_transaction_flush(&spi_devices[0]);
+ if (res)
+ CPRINTS("Failed to flush SPI: 0x%x", res);
/* we need CPU power to do the computations */
clock_enable_module(MODULE_FAST_CPU, 1);