Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4761051imu; Sat, 1 Dec 2018 02:25:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/WkLxOKmDkVwvPYmsF9rDVAQpGbqC5IAiTDKxg/Rk/gypnnVOOxvV9m1iHWZd48Ty3cx0SA X-Received: by 2002:a17:902:d891:: with SMTP id b17mr9075015plz.80.1543659934729; Sat, 01 Dec 2018 02:25:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543659934; cv=none; d=google.com; s=arc-20160816; b=IJoSU3Zfm7wCGLPdjFeNV4ZbhVHZLvUBtgOiRLjXAxi93IGflzEufscDR9rQ8Vuhjt 4b4i8txer0BePAWCe1rscT4dehrODnGd+3eeYIc8dLC9swlTdqjlXDBDczJ2USs5y1NT ji7L71vLLJdQk/BLI2Jnz9EnQEqMjdDzmpuxNeRqnmkLT+5COR1/EJz0bn/3wUG3JGi9 rdfdrD4l9x44jgnzQptaiv/5EseRXkxefMF9cP1Y1cbNwccccXQuBDTyrqPHsxxhwTyi YGqwuGtqyoonRgTnP2ygF2w2hGaoZD1NlqViEL/sjCFxkzDtmkf2NbpnUfJJT3kJQ4mu Ao2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1FFgPVAO7Lt9Fh8J3PvOFj46zw8MbZmEcShngNchViY=; b=I0zIAIia53DaZnc5VH79h/P8EEUS8har8EDxb29+Kega2HeUmSPNkscDyFKwtYVNRn YsunsSLR+1AUxw52qnNg0rCiiE+oIEbLVRESEiJzh4K9pOiBOg0cGSdxGwEcKRy0QBtZ D31JqMltWM9FvFGxmblF2CKwwtoZ9svs8s0MMCCT8hMSOAy4afrLVRRCRCIAfbdqXfHE cF8PwqIH9tsylb8Y6xO2yV3tOiakmt6FWJdOl95ysgyBESl1xXLK6dhsSJ1disSoke4e MdE2C5xN5Oe63R452oy0GQk5NT/g9VwwGUOi4VdAvsQpApI/xoMFTWXu2F27u9dFZNc8 Oafg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=oaVBFGWU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a26si7370657pgl.282.2018.12.01.02.25.19; Sat, 01 Dec 2018 02:25:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=oaVBFGWU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbeLAVfz (ORCPT + 99 others); Sat, 1 Dec 2018 16:35:55 -0500 Received: from merlin.infradead.org ([205.233.59.134]:47534 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbeLAVfz (ORCPT ); Sat, 1 Dec 2018 16:35:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1FFgPVAO7Lt9Fh8J3PvOFj46zw8MbZmEcShngNchViY=; b=oaVBFGWUpH9s2IMuDXcCntD95 Yq65Kq26e+CXiQpRY+mNrVEHE2BqEuF7dQQowk86365BHNJ07oh1me625Kx7eSa7MdXjtzenWNb5y kg/olW5jCo8KNc4E5X9M9TDVkOvmtc2ktem2MuecKS8H9s2Rkf4iTPP07VZlTqtYdbRBhp0z0vD2d PApvKSRV6veog1DgZuTXWOOR9lGvQ0t/StRrnO28ho1XgUPKEvNwc57O1tQnDyGG5As6P8nxToB5B f7gnVct3r0yOOnkRYlLfd+pbXSeJ0xxaHEKWrQ2g/VRlLY11VDfAEBcw+RT2bZOxJEo3blaG44UJx WKHxPQG/w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gT2Qu-00023O-Fo; Sat, 01 Dec 2018 10:23:32 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 476512029FD58; Sat, 1 Dec 2018 11:23:29 +0100 (CET) Date: Sat, 1 Dec 2018 11:23:29 +0100 From: Peter Zijlstra To: Andrea Parri Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Palmer Dabbelt , Albert Ou , Will Deacon , Boqun Feng Subject: Re: [PATCH] riscv, atomic: Add #define's for the atomic_{cmp,}xchg_*() variants Message-ID: <20181201102329.GD11614@hirez.programming.kicks-ass.net> References: <20181201000156.5366-1-andrea.parri@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181201000156.5366-1-andrea.parri@amarulasolutions.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 01, 2018 at 01:01:56AM +0100, Andrea Parri wrote: > If an architecture does not define the atomic_{cmp,}xchg_*() variants, > the generic implementation defaults them to the fully-ordered version. > > riscv's had its own variants since "the beginning", but it never told > (#define-d these for) the generic implementation: it is time to do so. > > Signed-off-by: Andrea Parri > Cc: Palmer Dabbelt > Cc: Albert Ou > Cc: Will Deacon > Cc: Peter Zijlstra > Cc: Boqun Feng Acked-by: Peter Zijlstra (Intel) > --- > arch/riscv/include/asm/atomic.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/arch/riscv/include/asm/atomic.h b/arch/riscv/include/asm/atomic.h > index c452359c9cb8a..93826771b616a 100644 > --- a/arch/riscv/include/asm/atomic.h > +++ b/arch/riscv/include/asm/atomic.h > @@ -303,6 +303,15 @@ c_t atomic##prefix##_cmpxchg(atomic##prefix##_t *v, c_t o, c_t n) \ > > ATOMIC_OPS() > > +#define atomic_xchg_relaxed atomic_xchg_relaxed > +#define atomic_xchg_acquire atomic_xchg_acquire > +#define atomic_xchg_release atomic_xchg_release > +#define atomic_xchg atomic_xchg > +#define atomic_cmpxchg_relaxed atomic_cmpxchg_relaxed > +#define atomic_cmpxchg_acquire atomic_cmpxchg_acquire > +#define atomic_cmpxchg_release atomic_cmpxchg_release > +#define atomic_cmpxchg atomic_cmpxchg > + > #undef ATOMIC_OPS > #undef ATOMIC_OP > > -- > 2.17.1 >