diff options
author | Rob Barnes <robbarnes@google.com> | 2023-04-20 10:28:28 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-05-15 19:42:56 +0000 |
commit | 42167827fbbc9d0100f151c2980d15a46e61957b (patch) | |
tree | e119282c50dec5421f55773cb1729cdf29f53c05 /core/cortex-m0/task.c | |
parent | 7b963a79c884a1584120e5413eae489679a30183 (diff) | |
download | chrome-ec-42167827fbbc9d0100f151c2980d15a46e61957b.tar.gz |
tasks: Only report stack overflow if task is enabled
Don't report stack overflow on a task that has been disabled.
Without this change, system safe mode will fail to recover from a
stackoverflow because the stackoverflow will be detected again, even
though the task has already been disabled.
BUG=b:278792557
TEST=System safe mode starts on boten after a stackoverflow
Change-Id: I59ab579c296d108dcd8c5aba9cb32bba6c7bbf54
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4455298
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Diffstat (limited to 'core/cortex-m0/task.c')
-rw-r--r-- | core/cortex-m0/task.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c index f63e9824db..315b8d6d16 100644 --- a/core/cortex-m0/task.c +++ b/core/cortex-m0/task.c @@ -231,7 +231,8 @@ task_ __attribute__((noinline)) * __svc_handler(int desched, task_id_t resched) current = current_task; #ifdef CONFIG_DEBUG_STACK_OVERFLOW - if (*current->stack != STACK_UNUSED_VALUE) { + if (*current->stack != STACK_UNUSED_VALUE && + task_enabled(current - tasks)) { panic_printf("\n\nStack overflow in %s task!\n", task_names[current - tasks]); software_panic(PANIC_SW_STACK_OVERFLOW, current - tasks); |