Skip to content

Commit 3d05b8a

Browse files
committed
Revert "parisc: Improve interrupt handling in arch_spin_lock_flags()"
This reverts commit 2772f0e. It turns out that we want to implement the spinlock code differently. Signed-off-by: Helge Deller <[email protected]> Cc: <[email protected]> # v5.7+
1 parent 693a065 commit 3d05b8a

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

arch/parisc/include/asm/spinlock.h

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,25 @@
1010
static inline int arch_spin_is_locked(arch_spinlock_t *x)
1111
{
1212
volatile unsigned int *a = __ldcw_align(x);
13-
smp_mb();
1413
return *a == 0;
1514
}
1615

17-
static inline void arch_spin_lock(arch_spinlock_t *x)
18-
{
19-
volatile unsigned int *a;
20-
21-
a = __ldcw_align(x);
22-
while (__ldcw(a) == 0)
23-
while (*a == 0)
24-
cpu_relax();
25-
}
16+
#define arch_spin_lock(lock) arch_spin_lock_flags(lock, 0)
2617

2718
static inline void arch_spin_lock_flags(arch_spinlock_t *x,
2819
unsigned long flags)
2920
{
3021
volatile unsigned int *a;
31-
unsigned long flags_dis;
3222

3323
a = __ldcw_align(x);
34-
while (__ldcw(a) == 0) {
35-
local_save_flags(flags_dis);
36-
local_irq_restore(flags);
24+
while (__ldcw(a) == 0)
3725
while (*a == 0)
38-
cpu_relax();
39-
local_irq_restore(flags_dis);
40-
}
26+
if (flags & PSW_SM_I) {
27+
local_irq_enable();
28+
cpu_relax();
29+
local_irq_disable();
30+
} else
31+
cpu_relax();
4132
}
4233
#define arch_spin_lock_flags arch_spin_lock_flags
4334

0 commit comments

Comments
 (0)