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/riscv-rv32i/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/riscv-rv32i/task.c')
-rw-r--r-- | core/riscv-rv32i/task.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/riscv-rv32i/task.c b/core/riscv-rv32i/task.c index 977987277b..48244bc1b2 100644 --- a/core/riscv-rv32i/task.c +++ b/core/riscv-rv32i/task.c @@ -289,9 +289,11 @@ task_ *__ram_code next_sched_task(void) #ifdef CONFIG_DEBUG_STACK_OVERFLOW if (*current_task->stack != STACK_UNUSED_VALUE) { int i = task_get_current(); - - panic_printf("\n\nStack overflow in %s task!\n", task_names[i]); - software_panic(PANIC_SW_STACK_OVERFLOW, i); + if (task_enabled(i)) { + panic_printf("\n\nStack overflow in %s task!\n", + task_names[i]); + software_panic(PANIC_SW_STACK_OVERFLOW, i); + } } #endif |