linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] locking/qrwlock: fix write unlock issue in big endian
@ 2016-06-02 10:09 Pan Xinhui
  2016-06-02 10:44 ` Arnd Bergmann
  2016-06-08  9:22 ` Will Deacon
  0 siblings, 2 replies; 13+ messages in thread
From: Pan Xinhui @ 2016-06-02 10:09 UTC (permalink / raw)
  To: linux-arch, linux-kernel; +Cc: arnd, waiman.long, peterz, Pan Xinhui

strcut __qrwlock has different layout in big endian machine. we need set
the __qrwlock->wmode to NULL, and the address is not &lock->cnts in big
endian machine.

Do as what read unlock does. we are lucky that the __qrwlock->wmode's
val is _QW_LOCKED.

Signed-off-by: Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
---
 include/asm-generic/qrwlock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/qrwlock.h b/include/asm-generic/qrwlock.h
index 54a8e65..eadd7a3 100644
--- a/include/asm-generic/qrwlock.h
+++ b/include/asm-generic/qrwlock.h
@@ -139,7 +139,7 @@ static inline void queued_read_unlock(struct qrwlock *lock)
  */
 static inline void queued_write_unlock(struct qrwlock *lock)
 {
-	smp_store_release((u8 *)&lock->cnts, 0);
+	(void)atomic_sub_return_release(_QW_LOCKED, &lock->cnts);
 }
 
 /*
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-06-15  3:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-02 10:09 [PATCH] locking/qrwlock: fix write unlock issue in big endian Pan Xinhui
2016-06-02 10:44 ` Arnd Bergmann
2016-06-02 11:01   ` xinhui
2016-06-02 11:15     ` Peter Zijlstra
2016-06-03  7:20       ` xinhui
2016-06-02 11:02   ` Peter Zijlstra
2016-06-03  7:17     ` xinhui
     [not found]     ` <201606030718.u537FQg0009963@mx0a-001b2d01.pphosted.com>
2016-06-03 20:57       ` Waiman Long
2016-06-06  3:15         ` xinhui
2016-06-08  9:22 ` Will Deacon
2016-06-14  6:11   ` xinhui
2016-06-14 10:40     ` Will Deacon
2016-06-15  3:47       ` xinhui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).