diff options
author | Andrew McRae <amcrae@google.com> | 2022-01-18 22:48:58 +1100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-18 21:33:46 +0000 |
commit | f2d37deda42d023574fbf4778aa7c578f91129d8 (patch) | |
tree | d1ebeb8083a32b18594de4295cbc2d414a1b8950 | |
parent | da1dded929444ebc878fc6c07f6c2d4bcb2cf699 (diff) | |
download | chrome-ec-f2d37deda42d023574fbf4778aa7c578f91129d8.tar.gz |
zephyr: Avoid calling task_get_current except in tasks.
task_get_current is being called in in_deferred_context(), which
may be invoked in initialisation code before the tasks
have been started (so shimmed_tasks_dyn was not initialised).
This fix avoids the use of any data that requires the EC tasks
to have been initialised or started.
BUG=b:213996924
TEST=zmake configure -b nivviks; flash and run
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: I0bd1a13a8d5bbf8b3204695b7f9977fe99f63437
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3397883
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r-- | zephyr/shim/src/tasks.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/zephyr/shim/src/tasks.c b/zephyr/shim/src/tasks.c index 851a179f3e..42f4fd6b33 100644 --- a/zephyr/shim/src/tasks.c +++ b/zephyr/shim/src/tasks.c @@ -376,7 +376,7 @@ inline bool in_deferred_context(void) /* * Deferred calls run in the sysworkq. */ - return (task_get_current() == TASK_ID_SYSWORKQ); + return (k_current_get() == &k_sys_work_q.thread); } #if IS_ENABLED(CONFIG_KERNEL_SHELL) && IS_ENABLED(CONFIG_THREAD_MONITOR) |