Received: by 10.213.65.68 with SMTP id h4csp93435imn; Thu, 5 Apr 2018 18:37:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+QWSxeFrRKWgVyqGgMLAn77R7fWVMHKEGa0FZaOGJ7nZ3vnR6yKyFL6UNTCv3lwC9Yj05G X-Received: by 10.99.100.68 with SMTP id y65mr16598489pgb.257.1522978638663; Thu, 05 Apr 2018 18:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522978638; cv=none; d=google.com; s=arc-20160816; b=SZQfVQgy40I3wsyyxZhgu3NGBkwHz+OL/4xs1yO25HWdCjTjQqqvJbpnU+ihBCRHIo YCgsdIuzukzEJ1cIAGyG/b3Nwck/VZohBEP1dMkrxLkd8dmEsPRBi876N/+BoAXTJBcn PkICqoUifclMiGbm4BZkG261AAt3nK3fWWxJtN1rw7lsMEo4Eg0RkZP4eNj6kO3f0Ymj J/3DTGW02ADjZIOMA942s6b9VOnyrNqpo16C9LTWiZc8JaSDMK5tB51rZ2YeDb1LQzza QlNPOrQOSjZzUzPYyQXOvCl+gqvHjjb98YsS4ChXyKjuV3XU9gIKodjqN0tgDZv1+OpH pxVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=jM/Ebh+8I8f/8CZBTRQ1ck2dELwjn9Qr+/5BpjLRJuk=; b=uzgx7zzAnWEHoRdq0JtbOJTFy2rRClJ3tLg2TyfHWGRMwxkOfGDS5CW89b+mj7OnZD Hu5hOoyvkuEavmUOLpSsy77MysBDQBh42znPBDEg2XVAKVEZkwuV8S8Mx4sW2qn4yhEX dz3vVYesbGronNeL/rqgsljX567KcjdUPQguaLF9H4HEDyhmEwlwApW2Fs2wDvdcszj5 OhQP1JP7qVwP5v8XyOeoSO07mPIk4DVi6LY9e1bXCaL+NICgqXwChF489cw4dYoajdzD 8ECtEw+soRLTHzfZfMqh0eGQ8UcQFJUlNsoW6TrWh8quCUkT4IVdVRvoUNR1kJKwOICz mN+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=o2sU71Zf; dkim=pass header.i=@codeaurora.org header.s=default header.b=JJvntSk3; 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 s76si7118291pfi.412.2018.04.05.18.37.05; Thu, 05 Apr 2018 18:37:18 -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=@codeaurora.org header.s=default header.b=o2sU71Zf; dkim=pass header.i=@codeaurora.org header.s=default header.b=JJvntSk3; 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 S1751544AbeDFBfR (ORCPT + 99 others); Thu, 5 Apr 2018 21:35:17 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:59974 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbeDFBfP (ORCPT ); Thu, 5 Apr 2018 21:35:15 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7A9A06081A; Fri, 6 Apr 2018 01:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522978514; bh=KQr2OtYOZtUY2q9VO5FYa/bc90VcJAfTaxLhJ8BRHfU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=o2sU71ZfQvP4WvBa96Mj+QPczkkqMUIBDNYSRZXRTwhH3/Uq3AS+iMSlX0dtNh9Jj z90ojbYMAN97AdZkOpGjw46io+nVumyrubbHA2d96nR47ARt9eWP+qStr24cGAddEz 9RWACJYqQV2XOUnnCAOQnqKIyRSnwLiWmt7ht2MA= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.0.105] (cpe-174-109-247-98.nc.res.rr.com [174.109.247.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id B519B607A2; Fri, 6 Apr 2018 01:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522978513; bh=KQr2OtYOZtUY2q9VO5FYa/bc90VcJAfTaxLhJ8BRHfU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=JJvntSk3su8WNlOAquuAB77lK44vFAFynlXqYYpnoxzyuTV3C5RQTF64o0WEFBaFE 10FLmpz+XuWBS0Pb9w77CB0z00TLMA+eEMktXoA1hOSwiTNIprybqfCGJHyBZJwTiQ HRPFPHSgABNKudKRIC1mGFrQdXC5JioQeo9Qb0MU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B519B607A2 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH] alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering To: linux-alpha@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org Cc: arnd@arndb.de, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Richard Henderson , Ivan Kokshaysky , Matt Turner , Philippe Ombredanne , Greg Kroah-Hartman , Guenter Roeck , Kate Stewart , linux-kernel@vger.kernel.org References: <1522691281-21593-1-git-send-email-okaya@codeaurora.org> From: Sinan Kaya Message-ID: <3c28281e-de52-abbe-36bc-06f5527da921@codeaurora.org> Date: Thu, 5 Apr 2018 21:35:10 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1522691281-21593-1-git-send-email-okaya@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/2/2018 1:48 PM, Sinan Kaya wrote: > memory-barriers.txt has been updated with the following requirement. > > "When using writel(), a prior wmb() is not needed to guarantee that the > cache coherent memory writes have completed before writing to the MMIO > region." > > Current writeX() and iowriteX() implementations on alpha are not > satisfying this requirement as the barrier is after the register write. > > Move mb() in writeX() and iowriteX() functions to guarantee that HW > observes memory changes before performing register operations. > > Signed-off-by: Sinan Kaya > Reported-by: Arnd Bergmann > --- > arch/alpha/include/asm/io.h | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h > index d123ff9..4c533fc 100644 > --- a/arch/alpha/include/asm/io.h > +++ b/arch/alpha/include/asm/io.h > @@ -341,14 +341,14 @@ extern inline unsigned int ioread16(void __iomem *addr) > > extern inline void iowrite8(u8 b, void __iomem *addr) > { > - IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr); > mb(); > + IO_CONCAT(__IO_PREFIX, iowrite8)(b, addr); > } > > extern inline void iowrite16(u16 b, void __iomem *addr) > { > - IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr); > mb(); > + IO_CONCAT(__IO_PREFIX, iowrite16)(b, addr); > } > > extern inline u8 inb(unsigned long port) > @@ -382,8 +382,8 @@ extern inline unsigned int ioread32(void __iomem *addr) > > extern inline void iowrite32(u32 b, void __iomem *addr) > { > - IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr); > mb(); > + IO_CONCAT(__IO_PREFIX, iowrite32)(b, addr); > } > > extern inline u32 inl(unsigned long port) > @@ -434,14 +434,14 @@ extern inline u16 readw(const volatile void __iomem *addr) > > extern inline void writeb(u8 b, volatile void __iomem *addr) > { > - __raw_writeb(b, addr); > mb(); > + __raw_writeb(b, addr); > } > > extern inline void writew(u16 b, volatile void __iomem *addr) > { > - __raw_writew(b, addr); > mb(); > + __raw_writew(b, addr); > } > #endif > > @@ -482,14 +482,14 @@ extern inline u64 readq(const volatile void __iomem *addr) > > extern inline void writel(u32 b, volatile void __iomem *addr) > { > - __raw_writel(b, addr); > mb(); > + __raw_writel(b, addr); > } > > extern inline void writeq(u64 b, volatile void __iomem *addr) > { > - __raw_writeq(b, addr); > mb(); > + __raw_writeq(b, addr); > } > #endif > > Can we get these merged to 4.17? There was a consensus to fix the architectures having API violation issues. https://www.mail-archive.com/netdev@vger.kernel.org/msg225971.html -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.