Revert "kernel/spinlock: Fix SPIN_VALIDATE in ISRs"

This reverts commit 93dc7e7438.

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 <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2024-04-26 09:38:00 +02:00 committed by Fabio Baltieri
parent ea26bcf8d3
commit c05cba682b

View file

@ -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)
@ -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;
}