Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4163220ybi; Mon, 3 Jun 2019 06:43:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAMvFqh3wtfC0AvQonLJgeTV4hy6YKeAfEGJZdFBgdn+rNu75TbvoGPM3gVCkZWeKksyuw X-Received: by 2002:a62:750c:: with SMTP id q12mr9896123pfc.59.1559569385881; Mon, 03 Jun 2019 06:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559569385; cv=none; d=google.com; s=arc-20160816; b=yUZEuUehAAaBC8hB3CE5TSK2xDWVgqNfw+JA11m7OtvUbSA4kPy3onFL3slY60N9pb RfiPaGBllwPLCqPEwfCAkiTh3ipJ2QoQRm5MLJv8bRhoGj2ecbHXy336pH4Y7t0Io448 pN1PxMa2R1fKg/vfXifTqadFuHEyxOUAYgetKpJgrXygluFE1FA+6lAVjuBTjTJSfppV xJ2vVpciY21hWrzGx0qey0PGTslXnhMVE+wXWAHNX9c6XBfL0X74rB9vGSpmrH1PTSiD nIQamuEd7Vq+0dtn6jI8J8fUCG6WQEiBFX+YZVu4gqs1I69CsVJ4df/qCJVL6TZmVJIe Wu7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=VYU0yV3lqUuGFDknFr3qL8pGjIjf+GFkOSn+t7h3la4=; b=VkFFvX10P8C01ENT84aMj7vMkEF436IB3xUPJ+i6zkcDCB71Q7/q/ZQe8cuy6sPSnO LCxv+G7A886qrOwQe16hIw/xUx7NFF+e5TusFCy2j5RoWNkqMzXqn1Hs5JyQ2EUNWQEc e/JllixmixrtYhn5uihSPJDtHnNGWi6glaCKbQbZ+KSzV2Xn6Vd7pKScT6fvFWm0ukgL 3y0XH+pvK+NWM1F715chdp47Xm9ijNwYQKolTuSlGmh9JISHSVCp4Q0PyyKVImMZ6xfj CR0CFKiXaBJSj9v3S5pf3O/lYQINZqL4OLN6sIWZAYwAN/Zu1LJPOC0vWsZiJn/F/ujQ Y9eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=gK0vQm6L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si7687604plk.67.2019.06.03.06.42.48; Mon, 03 Jun 2019 06:43:05 -0700 (PDT) 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=pass header.i=@zytor.com header.s=2019051801 header.b=gK0vQm6L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728899AbfFCNky (ORCPT + 99 others); Mon, 3 Jun 2019 09:40:54 -0400 Received: from terminus.zytor.com ([198.137.202.136]:37191 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727506AbfFCNky (ORCPT ); Mon, 3 Jun 2019 09:40:54 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x53DePpt611816 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 3 Jun 2019 06:40:25 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x53DePpt611816 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1559569225; bh=VYU0yV3lqUuGFDknFr3qL8pGjIjf+GFkOSn+t7h3la4=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=gK0vQm6LTdDC+dENnXDjWY1uviJCdf3l/mKbvGRKc6xqD2DIqCH4AeOFvKWvLwtRq lck/eSFOxAqNgeVr/iUKsJf/hxMDmRl09jsEsuDhzwsCefzfgk+XaCcuiQYPRYWh9H mG/aCMyecKW9CbIEyVSxR0PqSj/FzwqAWiEEF+8R/P77+rK2eMNXyiLRWMeY8QBYma 3gaDV1DhiiKU25xdJXu4vwTccayC0Fl7g5rGPaLQyAHpT+wvqOXG1IUF5v8g4eVY0w zTcxkY7D8uADtD1+//TL7nupusmBZZ63E88wNpLecVf721RGLb1FMmgmeCkhxXh9D6 0dBOBhcXAfmHQ== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x53DeODn611813; Mon, 3 Jun 2019 06:40:24 -0700 Date: Mon, 3 Jun 2019 06:40:24 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Mark Rutland Message-ID: Cc: hpa@zytor.com, mark.rutland@arm.com, peterz@infradead.org, mingo@kernel.org, torvalds@linux-foundation.org, will.deacon@arm.com, mpe@ellerman.id.au, tglx@linutronix.de, paulus@samba.org, linux-kernel@vger.kernel.org Reply-To: tglx@linutronix.de, will.deacon@arm.com, mpe@ellerman.id.au, paulus@samba.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, hpa@zytor.com, torvalds@linux-foundation.org, mingo@kernel.org, peterz@infradead.org In-Reply-To: <20190522132250.26499-11-mark.rutland@arm.com> References: <20190522132250.26499-11-mark.rutland@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/atomic, powerpc: Use s64 for atomic64 Git-Commit-ID: 8cd8de59748ba71b476d1b7101f9ecaccd5cb8c2 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 X-Spam-Status: No, score=-2.4 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 8cd8de59748ba71b476d1b7101f9ecaccd5cb8c2 Gitweb: https://git.kernel.org/tip/8cd8de59748ba71b476d1b7101f9ecaccd5cb8c2 Author: Mark Rutland AuthorDate: Wed, 22 May 2019 14:22:42 +0100 Committer: Ingo Molnar CommitDate: Mon, 3 Jun 2019 12:32:56 +0200 locking/atomic, powerpc: Use s64 for atomic64 As a step towards making the atomic64 API use consistent types treewide, let's have the powerpc atomic64 implementation use s64 as the underlying type for atomic64_t, rather than long, matching the generated headers. As atomic64_read() depends on the generic defintion of atomic64_t, this still returns long on 64-bit. This will be converted in a subsequent patch. Otherwise, there should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Michael Ellerman Cc: Linus Torvalds Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: aou@eecs.berkeley.edu Cc: arnd@arndb.de Cc: bp@alien8.de Cc: catalin.marinas@arm.com Cc: davem@davemloft.net Cc: fenghua.yu@intel.com Cc: heiko.carstens@de.ibm.com Cc: herbert@gondor.apana.org.au Cc: ink@jurassic.park.msu.ru Cc: jhogan@kernel.org Cc: linux@armlinux.org.uk Cc: mattst88@gmail.com Cc: palmer@sifive.com Cc: paul.burton@mips.com Cc: ralf@linux-mips.org Cc: rth@twiddle.net Cc: tony.luck@intel.com Cc: vgupta@synopsys.com Link: https://lkml.kernel.org/r/20190522132250.26499-11-mark.rutland@arm.com Signed-off-by: Ingo Molnar --- arch/powerpc/include/asm/atomic.h | 44 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h index 52eafaf74054..31c231ea56b7 100644 --- a/arch/powerpc/include/asm/atomic.h +++ b/arch/powerpc/include/asm/atomic.h @@ -297,24 +297,24 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v) #define ATOMIC64_INIT(i) { (i) } -static __inline__ long atomic64_read(const atomic64_t *v) +static __inline__ s64 atomic64_read(const atomic64_t *v) { - long t; + s64 t; __asm__ __volatile__("ld%U1%X1 %0,%1" : "=r"(t) : "m"(v->counter)); return t; } -static __inline__ void atomic64_set(atomic64_t *v, long i) +static __inline__ void atomic64_set(atomic64_t *v, s64 i) { __asm__ __volatile__("std%U0%X0 %1,%0" : "=m"(v->counter) : "r"(i)); } #define ATOMIC64_OP(op, asm_op) \ -static __inline__ void atomic64_##op(long a, atomic64_t *v) \ +static __inline__ void atomic64_##op(s64 a, atomic64_t *v) \ { \ - long t; \ + s64 t; \ \ __asm__ __volatile__( \ "1: ldarx %0,0,%3 # atomic64_" #op "\n" \ @@ -327,10 +327,10 @@ static __inline__ void atomic64_##op(long a, atomic64_t *v) \ } #define ATOMIC64_OP_RETURN_RELAXED(op, asm_op) \ -static inline long \ -atomic64_##op##_return_relaxed(long a, atomic64_t *v) \ +static inline s64 \ +atomic64_##op##_return_relaxed(s64 a, atomic64_t *v) \ { \ - long t; \ + s64 t; \ \ __asm__ __volatile__( \ "1: ldarx %0,0,%3 # atomic64_" #op "_return_relaxed\n" \ @@ -345,10 +345,10 @@ atomic64_##op##_return_relaxed(long a, atomic64_t *v) \ } #define ATOMIC64_FETCH_OP_RELAXED(op, asm_op) \ -static inline long \ -atomic64_fetch_##op##_relaxed(long a, atomic64_t *v) \ +static inline s64 \ +atomic64_fetch_##op##_relaxed(s64 a, atomic64_t *v) \ { \ - long res, t; \ + s64 res, t; \ \ __asm__ __volatile__( \ "1: ldarx %0,0,%4 # atomic64_fetch_" #op "_relaxed\n" \ @@ -396,7 +396,7 @@ ATOMIC64_OPS(xor, xor) static __inline__ void atomic64_inc(atomic64_t *v) { - long t; + s64 t; __asm__ __volatile__( "1: ldarx %0,0,%2 # atomic64_inc\n\ @@ -409,9 +409,9 @@ static __inline__ void atomic64_inc(atomic64_t *v) } #define atomic64_inc atomic64_inc -static __inline__ long atomic64_inc_return_relaxed(atomic64_t *v) +static __inline__ s64 atomic64_inc_return_relaxed(atomic64_t *v) { - long t; + s64 t; __asm__ __volatile__( "1: ldarx %0,0,%2 # atomic64_inc_return_relaxed\n" @@ -427,7 +427,7 @@ static __inline__ long atomic64_inc_return_relaxed(atomic64_t *v) static __inline__ void atomic64_dec(atomic64_t *v) { - long t; + s64 t; __asm__ __volatile__( "1: ldarx %0,0,%2 # atomic64_dec\n\ @@ -440,9 +440,9 @@ static __inline__ void atomic64_dec(atomic64_t *v) } #define atomic64_dec atomic64_dec -static __inline__ long atomic64_dec_return_relaxed(atomic64_t *v) +static __inline__ s64 atomic64_dec_return_relaxed(atomic64_t *v) { - long t; + s64 t; __asm__ __volatile__( "1: ldarx %0,0,%2 # atomic64_dec_return_relaxed\n" @@ -463,9 +463,9 @@ static __inline__ long atomic64_dec_return_relaxed(atomic64_t *v) * Atomically test *v and decrement if it is greater than 0. * The function returns the old value of *v minus 1. */ -static __inline__ long atomic64_dec_if_positive(atomic64_t *v) +static __inline__ s64 atomic64_dec_if_positive(atomic64_t *v) { - long t; + s64 t; __asm__ __volatile__( PPC_ATOMIC_ENTRY_BARRIER @@ -502,9 +502,9 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v) * Atomically adds @a to @v, so long as it was not @u. * Returns the old value of @v. */ -static __inline__ long atomic64_fetch_add_unless(atomic64_t *v, long a, long u) +static __inline__ s64 atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u) { - long t; + s64 t; __asm__ __volatile__ ( PPC_ATOMIC_ENTRY_BARRIER @@ -534,7 +534,7 @@ static __inline__ long atomic64_fetch_add_unless(atomic64_t *v, long a, long u) */ static __inline__ int atomic64_inc_not_zero(atomic64_t *v) { - long t1, t2; + s64 t1, t2; __asm__ __volatile__ ( PPC_ATOMIC_ENTRY_BARRIER