summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErick Reyes <erickreyes@google.com>2022-01-13 16:31:01 -0800
committerErick Reyes <erickreyes@google.com>2022-01-26 19:43:14 +0000
commit4504dcb0127800f115ef53342a86829c9b137244 (patch)
treea46881e39a02a0bb2fca96eeab637824040864d5
parent244016bebdc50f87947b4607ca82e70daf7f303c (diff)
downloadjaneiro-4504dcb0127800f115ef53342a86829c9b137244.tar.gz
edgetpu: janeiro: extend block shutdown time
After face unlock was enabled, we started seeing crashes when the TPU block exceeds the shutdown time. This commits increases the timeout to roughly double the highest time observed over ~100 iterations during experimentation, and logs a warning when the time is excessive. Bug: 214251686 Tested: 10 enroll/auth/delete cycles + 100 unlock attempts on Panther with no crashes. Signed-off-by: Erick Reyes <erickreyes@google.com> (cherry picked from commit fe84380d608375c60f50696b8c97903a2f20fcd4, re-applied after this change was undone by last merge) Change-Id: Ibf18851e91fcdb9b0d81a52a261fd07cfcbb03f5
-rw-r--r--drivers/edgetpu/janeiro-pm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/edgetpu/janeiro-pm.c b/drivers/edgetpu/janeiro-pm.c
index 3b56bb1..2a6dbee 100644
--- a/drivers/edgetpu/janeiro-pm.c
+++ b/drivers/edgetpu/janeiro-pm.c
@@ -21,7 +21,8 @@
#define SHUTDOWN_DELAY_US_MAX 20
#define BOOTUP_DELAY_US_MIN 200
#define BOOTUP_DELAY_US_MAX 250
-#define SHUTDOWN_MAX_DELAY_COUNT 50
+#define SHUTDOWN_MAX_DELAY_COUNT 1000
+#define SHUTDOWN_EXPECTED_DELAY_COUNT 50
#define EDGETPU_PSM0_CFG 0x1c1880
#define EDGETPU_PSM0_START 0x1c1884
@@ -107,7 +108,11 @@ static void janeiro_block_down(struct edgetpu_dev *etdev)
timeout_cnt++;
} while (timeout_cnt < SHUTDOWN_MAX_DELAY_COUNT);
if (timeout_cnt == SHUTDOWN_MAX_DELAY_COUNT)
- etdev_warn(etdev, "%s: blk_shutdown timeout\n", __func__);
+ etdev_warn(etdev, "%s: blk_shutdown timeout (%d uS) exceeded\n", __func__,
+ SHUTDOWN_MAX_DELAY_COUNT * SHUTDOWN_DELAY_US_MAX);
+ else if (timeout_cnt > SHUTDOWN_EXPECTED_DELAY_COUNT)
+ etdev_info(etdev, "%s: excessive shutdown time (%d uS)", __func__,
+ timeout_cnt * SHUTDOWN_DELAY_US_MAX);
}
static void janeiro_firmware_down(struct edgetpu_dev *etdev)