From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932525AbcFBKJs (ORCPT ); Thu, 2 Jun 2016 06:09:48 -0400 Received: from e38.co.us.ibm.com ([32.97.110.159]:60068 "EHLO e38.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932418AbcFBKJq (ORCPT ); Thu, 2 Jun 2016 06:09:46 -0400 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: xinhui.pan@linux.vnet.ibm.com X-IBM-RcptTo: arnd@arndb.de;waiman.long@hp.com;peterz@infradead.org;linux-arch@vger.kernel.org;linux-kernel@vger.kernel.org From: Pan Xinhui To: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, waiman.long@hp.com, peterz@infradead.org, Pan Xinhui Subject: [PATCH] locking/qrwlock: fix write unlock issue in big endian Date: Thu, 2 Jun 2016 18:09:08 +0800 Message-Id: <1464862148-5672-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> X-Mailer: git-send-email 1.9.1 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16060210-0029-0000-0000-00002C420D20 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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