summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-07-28 15:57:25 +0000
committerCommit Bot <commit-bot@chromium.org>2020-07-28 20:07:29 +0000
commit63498074bd3a77b28d2a96ef43aeceed51aa2bde (patch)
treefb2be7709e612d1446e896c56776193545dc7438 /core
parentce7692b4330dc86eeefba490d86fce607a304af0 (diff)
downloadchrome-ec-63498074bd3a77b28d2a96ef43aeceed51aa2bde.tar.gz
Revert "task: Fix mutex_lock() assert"
This reverts commit d53b71c17f7845a591fe4099b53717ec28bf5ccf. Reason for revert: Breaks jump to RW due to assert failing in chip/npcx/flash.c. Reverting while I come up with a better fix. Original change's description: > task: Fix mutex_lock() assert > > mutex_lock() must not be used in interrupt context. Add an assert > to catch this. > > Also add a check for task_start_called() since task ID is not valid > before this. > > Also remove an old assert since comparing id with TASK_ID_INVALID > doesn't make sense. > > BUG=b:160975910 > BRANCH=none > TEST=boot AP > > Signed-off-by: Edward Hill <ecgh@chromium.org> > Change-Id: I1a941fa78849a4efe586e66bb4787aa5a2a67732 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2309057 > Reviewed-by: Raul E Rangel <rrangel@chromium.org> Bug: b:160975910 b:160208802 b:162302011 Change-Id: Idb38bfc69892fd34a18b9fdc2b46bf8e086f97dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2323704 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m/task.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index 4dde20aa9a..75fbf99155 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -860,20 +860,7 @@ void mutex_lock(struct mutex *mtx)
uint32_t value;
uint32_t id = 1 << task_get_current();
- /*
- * Task ID is not valid before task_start() (since current_task is
- * scratchpad), and no need for mutex locking before task switching has
- * begun.
- */
- if (!task_start_called())
- return;
-
- /*
- * mutex_lock() must not be used in interrupt context (because we wait
- * if there is contention).
- */
- ASSERT(!in_interrupt_context());
-
+ ASSERT(id != TASK_ID_INVALID);
atomic_or(&mtx->waiters, id);
do {