Skip to content

Commit

Permalink
Revert "kernel/spinlock: Fix SPIN_VALIDATE in ISRs"
Browse files Browse the repository at this point in the history
This reverts commit 93dc7e7.

This PR introduced 2 regressions in main CI:
71977 & 71978
Let's revert it by now to get main's CI passing again.

(cherry picked from commit c05cba6)

Original-Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
GitOrigin-RevId: c05cba6
Change-Id: I18bcd146a1e7b17105dff667b6dec1e9aca8c76d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5494022
Commit-Queue: Dawid Niedźwiecki <dawidn@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Dawid Niedźwiecki <dawidn@google.com>
Tested-by: Dawid Niedźwiecki <dawidn@google.com>
  • Loading branch information
aescolar authored and Chromeos LUCI committed Apr 26, 2024
1 parent e92efe1 commit 6578e31
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions kernel/spinlock_validate.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel_internal.h>
#include <zephyr/kernel.h>
#include <zephyr/spinlock.h>

bool z_spin_lock_valid(struct k_spinlock *l)
Expand All @@ -20,17 +20,10 @@ bool z_spin_lock_valid(struct k_spinlock *l)

bool z_spin_unlock_valid(struct k_spinlock *l)
{
uintptr_t tcpu = l->thread_cpu;

l->thread_cpu = 0;

if (arch_is_in_isr() && _current->base.thread_state & _THREAD_DUMMY) {
/* Edge case where an ISR aborted _current */
return true;
}
if (tcpu != (_current_cpu->id | (uintptr_t)_current)) {
if (l->thread_cpu != (_current_cpu->id | (uintptr_t)_current)) {
return false;
}
l->thread_cpu = 0;
return true;
}

Expand Down

0 comments on commit 6578e31

Please sign in to comment.