powerpc: use spin loop primitives in some functions
Use the different spin loop primitives in some simple powerpc spin loops, including those which will spin as a common case. This will help to test the spin loop primitives before more conversions are done. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [mpe: Add some includes of <linux/processor.h>] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
ede8e2bbb0
commit
4e287e655e
@@ -15,6 +15,7 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/processor.h>
|
||||
#include <linux/threads.h>
|
||||
#include <linux/smp.h>
|
||||
|
||||
@@ -184,8 +185,10 @@ static inline void native_lock_hpte(struct hash_pte *hptep)
|
||||
while (1) {
|
||||
if (!test_and_set_bit_lock(HPTE_LOCK_BIT, word))
|
||||
break;
|
||||
spin_begin();
|
||||
while(test_bit(HPTE_LOCK_BIT, word))
|
||||
cpu_relax();
|
||||
spin_cpu_relax();
|
||||
spin_end();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user