Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753896AbbFBNXB (ORCPT ); Tue, 2 Jun 2015 09:23:01 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:60763 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758976AbbFBNWt (ORCPT ); Tue, 2 Jun 2015 09:22:49 -0400 Date: Tue, 2 Jun 2015 15:22:43 +0200 From: Ralf Baechle To: James Hogan Cc: Leonid Yegoshin , linux-mips@linux-mips.org, benh@kernel.crashing.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, markos.chandras@imgtec.com, macro@linux-mips.org, Steven.Hill@imgtec.com, alexander.h.duyck@redhat.com, davem@davemloft.net Subject: Re: [PATCH 3/3] MIPS: bugfix - replace smp_mb with release barrier function in unlocks Message-ID: <20150602132243.GI29986@linux-mips.org> References: <20150602000818.6668.76632.stgit@ubuntu-yegoshin> <20150602000952.6668.82483.stgit@ubuntu-yegoshin> <556D96B0.3050409@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <556D96B0.3050409@imgtec.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1928 Lines: 51 On Tue, Jun 02, 2015 at 12:42:40PM +0100, James Hogan wrote: > Replace. > > > smp_mb__before_llsc() call which does "release" barrier functionality. > > > > It seems like it was missed in commit f252ffd50c97dae87b45f1dbad24f71358ccfbd6 > > during introduction of "acquire" and "release" semantics. > > > > Signed-off-by: Leonid Yegoshin > > --- > > arch/mips/include/asm/bitops.h | 2 +- > > arch/mips/include/asm/spinlock.h | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h > > index 0cf29bd5dc5c..ce9666cf1499 100644 > > --- a/arch/mips/include/asm/bitops.h > > +++ b/arch/mips/include/asm/bitops.h > > @@ -469,7 +469,7 @@ static inline int test_and_change_bit(unsigned long nr, > > */ > > static inline void __clear_bit_unlock(unsigned long nr, volatile unsigned long *addr) > > { > > - smp_mb(); > > + smp_mb__before_llsc(); > > __clear_bit(nr, addr); > > } > > > > diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h > > index 1fca2e0793dc..7c7f3b2bd3de 100644 > > --- a/arch/mips/include/asm/spinlock.h > > +++ b/arch/mips/include/asm/spinlock.h > > @@ -317,7 +317,7 @@ static inline void arch_write_lock(arch_rwlock_t *rw) > > > > static inline void arch_write_unlock(arch_rwlock_t *rw) > > { > > - smp_mb(); > > + smp_mb__before_llsc(); > > arch_write_unlock appears to just use sw, not sc, and __clear_bit > appears to be implemented in plain C, so is smp_mb__before_llsc() really > appropriate? Would smp_release() be more accurate/correct in both cases? Yes on the both questions. Ralf -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/