From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755499AbbIMLP4 (ORCPT ); Sun, 13 Sep 2015 07:15:56 -0400 Received: from terminus.zytor.com ([198.137.202.10]:44145 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752628AbbIMLPx (ORCPT ); Sun, 13 Sep 2015 07:15:53 -0400 Date: Sun, 13 Sep 2015 04:07:23 -0700 From: tip-bot for Boqun Feng Message-ID: Cc: aybuke.147@gmail.com, mingo@kernel.org, sshah@solarflare.com, tglx@linutronix.de, chris@the-brannons.com, boqun.feng@gmail.com, w.d.hubbs@gmail.com, will.deacon@arm.com, peterz@infradead.org, gregkh@linuxfoundation.org, dave@stgolabs.net, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, kishon@ti.com, kirk@reisers.ca, samuel.thibault@ens-lyon.org, hpa@zytor.com, paulmck@linux.vnet.ibm.com, corbet@lwn.net, akpm@linux-foundation.org Reply-To: w.d.hubbs@gmail.com, will.deacon@arm.com, peterz@infradead.org, gregkh@linuxfoundation.org, aybuke.147@gmail.com, sshah@solarflare.com, mingo@kernel.org, boqun.feng@gmail.com, chris@the-brannons.com, tglx@linutronix.de, samuel.thibault@ens-lyon.org, akpm@linux-foundation.org, corbet@lwn.net, hpa@zytor.com, paulmck@linux.vnet.ibm.com, dave@stgolabs.net, kishon@ti.com, kirk@reisers.ca, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org In-Reply-To: <1440589966-26280-1-git-send-email-boqun.feng@gmail.com> References: <1440589966-26280-1-git-send-email-boqun.feng@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/atomics, cmpxchg: Privatize the inclusion of asm/cmpxchg.h Git-Commit-ID: 84567995612258c23bc55795575babe7ef605dd9 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 84567995612258c23bc55795575babe7ef605dd9 Gitweb: http://git.kernel.org/tip/84567995612258c23bc55795575babe7ef605dd9 Author: Boqun Feng AuthorDate: Wed, 26 Aug 2015 19:52:46 +0800 Committer: Ingo Molnar CommitDate: Sun, 13 Sep 2015 10:35:46 +0200 locking/atomics, cmpxchg: Privatize the inclusion of asm/cmpxchg.h After commit: 654672d4ba1a ("locking/atomics: Add _{acquire|release|relaxed}() variants of some atomic operations") Architectures may only provide {cmp,}xchg_relaxed definitions in asm/cmpxchg.h. Other variants, such as {cmp,}xchg, may be built in linux/atomic.h, which means simply including asm/cmpxchg.h may not get the definitions of all the{cmp,}xchg variants. Therefore, we should privatize the inclusions of asm/cmpxchg.h to keep it only included in arch/* and replace the inclusions outside with linux/atomic.h Signed-off-by: Boqun Feng Signed-off-by: Peter Zijlstra (Intel) Acked-by: Greg Kroah-Hartman Acked-by: Will Deacon Cc: Andrew Morton Cc: Aybuke Ozdemir Cc: Chris Brannon Cc: Davidlohr Bueso Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Kirk Reiser Cc: Kishon Vijay Abraham I Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Samuel Thibault Cc: Shradha Shah Cc: Thomas Gleixner Cc: William Hubbs Cc: devel@driverdev.osuosl.org Cc: linux-net-drivers@solarflare.com Cc: speakup@linux-speakup.org Link: http://lkml.kernel.org/r/1440589966-26280-1-git-send-email-boqun.feng@gmail.com Signed-off-by: Ingo Molnar --- Documentation/atomic_ops.txt | 4 ++++ drivers/net/ethernet/sfc/mcdi.c | 2 +- drivers/phy/phy-rcar-gen2.c | 3 +-- drivers/staging/speakup/selection.c | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt index b19fc34..c9d1cac 100644 --- a/Documentation/atomic_ops.txt +++ b/Documentation/atomic_ops.txt @@ -542,6 +542,10 @@ The routines xchg() and cmpxchg() must provide the same exact memory-barrier semantics as the atomic and bit operations returning values. +Note: If someone wants to use xchg(), cmpxchg() and their variants, +linux/atomic.h should be included rather than asm/cmpxchg.h, unless +the code is in arch/* and can take care of itself. + Spinlocks and rwlocks have memory barrier expectations as well. The rule to follow is simple: diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index 98d172b..a9b9460 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c @@ -9,7 +9,7 @@ #include #include -#include +#include #include "net_driver.h" #include "nic.h" #include "io.h" diff --git a/drivers/phy/phy-rcar-gen2.c b/drivers/phy/phy-rcar-gen2.c index 6e0d9fa..c7a0599 100644 --- a/drivers/phy/phy-rcar-gen2.c +++ b/drivers/phy/phy-rcar-gen2.c @@ -17,8 +17,7 @@ #include #include #include - -#include +#include #define USBHS_LPSTS 0x02 #define USBHS_UGCTRL 0x80 diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c index 98af3b1..aa5ab6c 100644 --- a/drivers/staging/speakup/selection.c +++ b/drivers/staging/speakup/selection.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include "speakup.h"