@@ -35,6 +35,7 @@ config ARM
select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_CMPXCHG_LOCKREF
select ARCH_USE_QUEUED_RWLOCKS if !CPU_V6
+ select ARCH_USE_QUEUED_SPINLOCKS if !CPU_V6
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
select ARCH_WANT_IPC_PARSE_VERSION
select BINFMT_FLAT_ARGVP_ENVP_ON_STACK
@@ -18,6 +18,7 @@ generic-y += preempt.h
generic-y += seccomp.h
generic-y += serial.h
generic-y += trace_clock.h
+generic-y += qspinlock.h
generic-y += qrwlock.h
generated-y += mach-types.h
@@ -45,6 +45,7 @@ static inline void dsb_sev(void)
__asm__(SEV);
}
+#ifdef CONFIG_CPU_V6
/*
* ARMv6 ticket-based spin-locking.
*
@@ -128,7 +129,6 @@ static inline int arch_spin_is_contended(arch_spinlock_t *lock)
}
#define arch_spin_is_contended arch_spin_is_contended
-#ifdef CONFIG_CPU_V6
/*
* RWLOCKS
*
@@ -274,7 +274,8 @@ static inline int arch_read_trylock(arch_rwlock_t *rw)
#else
#include <asm/qrwlock.h>
-#define smp_mb__after_spinlock() smp_mb()
+#include <asm/qspinlock.h>
+#define smp_mb__after_spinlock() smp_mb()
#endif
@@ -6,6 +6,7 @@
# error "please don't include this file directly"
#endif
+#ifdef CONFIG_CPU_V6
#define TICKET_SHIFT 16
typedef struct {
@@ -29,12 +30,11 @@ typedef struct {
u32 lock;
} arch_rwlock_t;
-#ifdef CONFIG_CPU_V6
-
#define __ARCH_RW_LOCK_UNLOCKED { 0 }
#else
+#include <asm-generic/qspinlock_types.h>
#include <asm-generic/qrwlock_types.h>
#endif
Use the generic queued spinlock implementation for spinlock. The WFE mechanism is used as part of arch_mcs_spin_lock_contended(). Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> --- arch/arm/Kconfig | 1 + arch/arm/include/asm/Kbuild | 1 + arch/arm/include/asm/spinlock.h | 5 +++-- arch/arm/include/asm/spinlock_types.h | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-)