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-13 16:31:01 -0800
commitfe84380d608375c60f50696b8c97903a2f20fcd4 (patch)
tree4c6af256ee2089e55d4db5daa683818936bf357a
parentc8f1888c32b8a3d7ae00f47ae80b986ac7eda678 (diff)
downloadjaneiro-fe84380d608375c60f50696b8c97903a2f20fcd4.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> Change-Id: Ie48e995bff313a4b107eac3f9bc82fa886ca7b03
-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)