summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Rawling <mwr@google.com>2022-06-01 00:16:42 -0700
committerMark Rawling <mwr@google.com>2022-06-01 01:06:23 -0700
commite9e9ecbdaa63ce81d0ab51b127e150e8a132a3b9 (patch)
tree8f81f9265ce8b34ce5f3b69e1f337737d07c9b3a
parent5971f77cf6682bbb686c24e43301d2cf5534f40b (diff)
downloadnanohub-e9e9ecbdaa63ce81d0ab51b127e150e8a132a3b9.tar.gz
Don't reset the MCU on nanohub errors
We have observed in b/231130162 that nanohub can reset the MCU shortly after a firmware download. Whilst we rely on the MCU watchdog to catch and handle any and all cases like this, this is not supposed to happen and it can interfere with the MCU watchdog, restarts and crash reporting. It can also lead to errors in telemetry. Although resets were being logged in the past, they weren't actually being performed, so here we also change the log to be more accurate. Bug: 231130162 Test: manually induced errors and verified behaviour Change-Id: I232dc218f3131cac3140a5ee63b8a84c86fd2a42
-rw-r--r--main.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/main.c b/main.c
index 3a37d62..94d28b6 100644
--- a/main.c
+++ b/main.c
@@ -374,7 +374,6 @@ int request_wakeup_ex(struct nanohub_data *data, long timeout_ms,
long timeout;
bool priority_lock = lock_mode > LOCK_MODE_NORMAL;
struct device *dev = data->io[ID_NANOHUB_COMMS].dev;
- int ret;
ktime_t ktime_delta;
ktime_t wakeup_ktime;
@@ -404,14 +403,15 @@ int request_wakeup_ex(struct nanohub_data *data, long timeout_ms,
&& data->wakeup_err_cnt > WAKEUP_ERR_CNT) {
mcu_wakeup_gpio_put_locked(data, priority_lock);
spin_unlock(&data->wakeup_wait.lock);
- dev_info(dev,
- "wakeup: hard reset due to consistent error\n");
- ret = nanohub_hw_reset(data);
- if (ret) {
- dev_info(dev,
- "%s: failed to reset nanohub: ret=%d\n",
- __func__, ret);
- }
+ dev_info(dev, "wakeup: consistent error\n");
+ // dev_info(dev,
+ // "wakeup: hard reset due to consistent error\n");
+ // ret = nanohub_hw_reset(data);
+ // if (ret) {
+ // dev_info(dev,
+ // "%s: failed to reset nanohub: ret=%d\n",
+ // __func__, ret);
+ // }
return -ETIME;
}
}
@@ -1592,14 +1592,15 @@ static int nanohub_kthread(void *arg)
data->kthread_err_ktime);
if (ktime_to_ns(ktime_delta) > KTHREAD_ERR_TIME_NS
&& data->kthread_err_cnt > KTHREAD_ERR_CNT) {
- dev_info(dev,
- "kthread: hard reset due to consistent error\n");
- ret = nanohub_hw_reset(data);
- if (ret) {
- dev_info(dev,
- "%s: failed to reset nanohub: ret=%d\n",
- __func__, ret);
- }
+ dev_info(dev, "kthread: consistent error\n");
+ // dev_info(dev,
+ // "kthread: hard reset due to consistent error\n");
+ // ret = nanohub_hw_reset(data); //
+ // if (ret) {
+ // dev_info(dev,
+ // "%s: failed to reset nanohub: ret=%d\n",
+ // __func__, ret);
+ // }
}
msleep_interruptible(WAKEUP_TIMEOUT_MS);
nanohub_set_state(data, ST_RUNNING);