From c05cba682b40a5fc1211840a849d7528b56d17a0 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Fri, 26 Apr 2024 09:38:00 +0200 Subject: [PATCH] Revert "kernel/spinlock: Fix SPIN_VALIDATE in ISRs" This reverts commit 93dc7e7438246e5540fb922108156ef1b89bbe22. This PR introduced 2 regressions in main CI: 71977 & 71978 Let's revert it by now to get main's CI passing again. Signed-off-by: Alberto Escolar Piedras --- kernel/spinlock_validate.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/kernel/spinlock_validate.c b/kernel/spinlock_validate.c index cb7ff5a3e7..90da6fac1b 100644 --- a/kernel/spinlock_validate.c +++ b/kernel/spinlock_validate.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include bool z_spin_lock_valid(struct k_spinlock *l) @@ -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; }