Skip to content

Commit c05cba6

Browse files
aescolarfabiobaltieri
authored andcommitted
Revert "kernel/spinlock: Fix SPIN_VALIDATE in ISRs"
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. Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent ea26bcf commit c05cba6

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

kernel/spinlock_validate.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6-
#include <kernel_internal.h>
6+
#include <zephyr/kernel.h>
77
#include <zephyr/spinlock.h>
88

99
bool z_spin_lock_valid(struct k_spinlock *l)
@@ -20,17 +20,10 @@ bool z_spin_lock_valid(struct k_spinlock *l)
2020

2121
bool z_spin_unlock_valid(struct k_spinlock *l)
2222
{
23-
uintptr_t tcpu = l->thread_cpu;
24-
25-
l->thread_cpu = 0;
26-
27-
if (arch_is_in_isr() && _current->base.thread_state & _THREAD_DUMMY) {
28-
/* Edge case where an ISR aborted _current */
29-
return true;
30-
}
31-
if (tcpu != (_current_cpu->id | (uintptr_t)_current)) {
23+
if (l->thread_cpu != (_current_cpu->id | (uintptr_t)_current)) {
3224
return false;
3325
}
26+
l->thread_cpu = 0;
3427
return true;
3528
}
3629

0 commit comments

Comments
 (0)