Thread (9 messages) flat view 9 messages, 3 authors, 2019-08-06

Re: [PATCH v2 3/3] powerpc/spinlocks: Fix oops in shared-processor spinlocks

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2019-08-02 13:01:07

"Christopher M. Riedl" [off-list ref] writes:
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index 0a8270183770..6aed8a83b180 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -124,6 +122,22 @@ static inline bool is_shared_processor(void)
 #endif
 }
 
+static inline void spin_yield(arch_spinlock_t *lock)
+{
+	if (is_shared_processor())
+		splpar_spin_yield(lock);
+	else
+		barrier();
+}
...
quoted hunk ↗ jump to hunk
 static inline void arch_spin_lock(arch_spinlock_t *lock)
 {
 	while (1) {
@@ -132,7 +146,7 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
 		do {
 			HMT_low();
 			if (is_shared_processor())
-				__spin_yield(lock);
+				spin_yield(lock);
This leaves us with a double test of is_shared_processor() doesn't it?

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help