Skip to content

Commit

Permalink
Merge branch 'parisc-4.20-3' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/deller/parisc-linux

Pull parisc fix from Helge Deller:
 "Revert one patch which changed how spinlocks get released. It breaks
  the rwlock implementation in glibc"

* 'parisc-4.20-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: Revert "Release spinlocks using ordered store"
  • Loading branch information
Linus Torvalds committed Nov 14, 2018
2 parents e2f8b47 + 86d4d06 commit 857c34c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions arch/parisc/include/asm/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ static inline void arch_spin_unlock(arch_spinlock_t *x)
volatile unsigned int *a;

a = __ldcw_align(x);
/* Release with ordered store. */
__asm__ __volatile__("stw,ma %0,0(%1)" : : "r"(1), "r"(a) : "memory");
mb();
*a = 1;
}

static inline int arch_spin_trylock(arch_spinlock_t *x)
Expand Down
12 changes: 8 additions & 4 deletions arch/parisc/kernel/syscall.S
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,8 @@ cas_action:
sub,<> %r28, %r25, %r0
2: stw %r24, 0(%r26)
/* Free lock */
stw,ma %r20, 0(%sr2,%r20)
sync
stw %r20, 0(%sr2,%r20)
#if ENABLE_LWS_DEBUG
/* Clear thread register indicator */
stw %r0, 4(%sr2,%r20)
Expand All @@ -654,7 +655,8 @@ cas_action:
3:
/* Error occurred on load or store */
/* Free lock */
stw,ma %r20, 0(%sr2,%r20)
sync
stw %r20, 0(%sr2,%r20)
#if ENABLE_LWS_DEBUG
stw %r0, 4(%sr2,%r20)
#endif
Expand Down Expand Up @@ -855,7 +857,8 @@ cas2_action:

cas2_end:
/* Free lock */
stw,ma %r20, 0(%sr2,%r20)
sync
stw %r20, 0(%sr2,%r20)
/* Enable interrupts */
ssm PSW_SM_I, %r0
/* Return to userspace, set no error */
Expand All @@ -865,7 +868,8 @@ cas2_end:
22:
/* Error occurred on load or store */
/* Free lock */
stw,ma %r20, 0(%sr2,%r20)
sync
stw %r20, 0(%sr2,%r20)
ssm PSW_SM_I, %r0
ldo 1(%r0),%r28
b lws_exit
Expand Down

0 comments on commit 857c34c

Please sign in to comment.