Received: by 10.213.65.68 with SMTP id h4csp139870imn; Thu, 5 Apr 2018 19:50:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+0C9+TsMcMFbSxg36xmc266mCsl99VO7kitHeiP2N16+jpp+DHJykzUSj8r9LId91qYQ0A X-Received: by 2002:a17:902:8602:: with SMTP id f2-v6mr24751476plo.73.1522983025869; Thu, 05 Apr 2018 19:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522983025; cv=none; d=google.com; s=arc-20160816; b=ko+AfR1ENLldkr88HtiIq35C/hjKaAfIDIJFIwhrJkOZpOjiuwusg6ke+TpapjE4pa fsi9lCVP35rL10oKtzOTvXNTc+wWsJJkS3aNJgxPdy6Al2ev7LWhktG+te56bEYANYPh 3UIndvv9OozEIIW/Mkg8Psq6Ntz5XBM6Mfvdo/oy59LoGgdVu/6rmiVIIwVMPdYze0N4 CHuiFkYl8PUve9OfzzldG7WU25GL4Yzyl7s/RokCHV1Lfq62K/W1mlYsTjThuFzFDCJF rZh7zO+1LsIf9Vc/UUY0c1NlQbdhJVN2RcV3r1Oh1d+rl5qvgOBDmQ3rrVj9IWTV33Bv dOYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=GtELyCStUh+SeGJAp5V5A1QYyaK3cae4sEDbLq2+wQw=; b=DfWgftULC5VG26hxAvacCVlxFjavHGvWmdU9qBNxiBqSWJgusTcaSKyf5F9WP774EL 59rKwfVnPG3CN9cp6Dj9lUS4fxCIUFCAsUXJpY+cejO8jTW0YwiSdD9Nm7IUewsKVdkH y8MozlypuJDHrpYYQ4e2en6rpzJY0lJ8HV/zqDyffj0ZNxaBKVtmK/Q8T3a2E53HxoW3 wH0MRVJEZqESEPVDTjT6cmXMuzIVLV6mO3OpyW40tZeKWDWfPvfOXmkTIYSY9MuqzijF VFDQA4yqricEjtXVOhTC2Pp04GqSIHo5CbIBC1QCH+758rfR2yN5YmExLnCowNahH3dP FgTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XM4TG9P9; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si3419421pff.182.2018.04.05.19.50.11; Thu, 05 Apr 2018 19:50:25 -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=@gmail.com header.s=20161025 header.b=XM4TG9P9; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751518AbeDFCsd (ORCPT + 99 others); Thu, 5 Apr 2018 22:48:33 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:38010 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbeDFCsb (ORCPT ); Thu, 5 Apr 2018 22:48:31 -0400 Received: by mail-io0-f196.google.com with SMTP id b20so32991850iof.5; Thu, 05 Apr 2018 19:48:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GtELyCStUh+SeGJAp5V5A1QYyaK3cae4sEDbLq2+wQw=; b=XM4TG9P9wJHMvDpqCTZymamYhgt/ll0uFcc+R9wUlGuO9E1tS3qs2j+H2WjZTbmI/M /Wo/zB8lx/+GNl2RxhrFNHvAwW2ic+5+iJto3d4hvsICIOcNLJuwf6iIiIAfvIgEQA64 ppwZskwUVmxduRhrRvgAExrk759SefkEArUuUOjcfxcfYSTCjnZpRMvRwPD6Qq7qKZEr c6gbq7X8MVgXpHyyWrd2zTloNUFGbToaeEF6tFYlZfsYcQ4z4IHFDtK8IQN1e4y30YGx atOQLiVA3ccBbV6vcSOH947CgqUWgHkLf6vbXBuUJdElTn8QFBh6mvESazfmid5U2zWt N7NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GtELyCStUh+SeGJAp5V5A1QYyaK3cae4sEDbLq2+wQw=; b=Yhpsfam3+OKRk58ULGhetuqs78x0rz7y84obhsAw0jP0yQ26Ey5Z1sLQIP0BSjHyj3 rt/+prNaAz+/O4twhiD9r+iq5S4YdnKyepOKoHejE6aWkrlX/lfrdqd1NHrqK8EnDu0K frAEXrTrsDL5zCRMUUrOMi47S8QneNt1U23RsnUSvc89iCGpE/dYDd2mIwB9byJOd4dR ZTLAsY7JiQfp5wIqmCU31jBHKo7GGJioGvfh33VNGmhsEfO8RM4fiyJ9Xg7ywcBH7x1A cQF1HQs/kEeRBI7FMAz8P4aa+cnk36Pn++imj7Cacny5q2A/CL3cAeZeY/II6gqwQ3dI gUOQ== X-Gm-Message-State: AElRT7FKvKpE4BwvqmRLcUdXh0TchUs+vZQ466kAIrGRJanw5Hu54iUN awRuhUHzSWpYw/8OYTAFbwTUkMDeP3AgG3btuf0= X-Received: by 10.107.2.7 with SMTP id 7mr23109010ioc.187.1522982910744; Thu, 05 Apr 2018 19:48:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.113.38 with HTTP; Thu, 5 Apr 2018 19:48:10 -0700 (PDT) In-Reply-To: <3c28281e-de52-abbe-36bc-06f5527da921@codeaurora.org> References: <1522691281-21593-1-git-send-email-okaya@codeaurora.org> <3c28281e-de52-abbe-36bc-06f5527da921@codeaurora.org> From: Matt Turner Date: Thu, 5 Apr 2018 19:48:10 -0700 Message-ID: Subject: Re: [PATCH] alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering To: Sinan Kaya Cc: linux-alpha , timur@codeaurora.org, sulrich@codeaurora.org, Arnd Bergmann , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Richard Henderson , Ivan Kokshaysky , Philippe Ombredanne , Greg Kroah-Hartman , Guenter Roeck , Kate Stewart , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 5, 2018 at 6:35 PM, Sinan Kaya wrote: > 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 I expect so. Sorry I haven't had time to collect patches yet. I think tomorrow or the next day I will.