From patchwork Tue Sep 9 12:12:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 37104 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8CB0620566 for ; Tue, 9 Sep 2014 12:13:11 +0000 (UTC) Received: by mail-oi0-f72.google.com with SMTP id v63sf2253704oia.11 for ; Tue, 09 Sep 2014 05:13:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=n6EhKWt0ZV+XYNNYuROPhahQObSQ3YH+48tF59WMF08=; b=dJZ6UF1YIHNJSd63q/h8CpcF9BrSeqqKkfsn350fPbBEw4myrvsYB+ZkcIdQS7bQUx g+La8i5jnkxFTkI8FBQh2lL/786YZuFuTzqA0CC1ZxTrhK918Rxgwec0NzqgEpTyxsiE yppwKE85cZh3NYGX3172yhZxQeQPWhic93UZojeOLUHoBHoW7tL0xTamR0hot9ymZxPN RXpa6RAkMZs2jMPVNigtLKN3qrnZoHHmIZOmGdltaNbOgjkGEDUdJxpXklWTy0WbuSwr QFv+Uu0xpKwUkrq9CQgu2ASlwfa/1q00QIxPIMoWUODisafS/NIG9E5Q+zxHWTeHHSBK D4IQ== X-Gm-Message-State: ALoCoQn/1tQqAQ28pGkibog21tNLkSgONU4DxLwBioAw8OouG4gSV3xFoh6XHEvpUBNaENFLexBr X-Received: by 10.182.131.226 with SMTP id op2mr20656745obb.17.1410264791176; Tue, 09 Sep 2014 05:13:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.176 with SMTP id t45ls2118350qgt.60.gmail; Tue, 09 Sep 2014 05:13:11 -0700 (PDT) X-Received: by 10.221.23.198 with SMTP id rb6mr29903475vcb.19.1410264791103; Tue, 09 Sep 2014 05:13:11 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id m1si2255293vda.49.2014.09.09.05.13.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 05:13:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf12so16708556vcb.20 for ; Tue, 09 Sep 2014 05:13:11 -0700 (PDT) X-Received: by 10.52.1.39 with SMTP id 7mr25427460vdj.17.1410264791002; Tue, 09 Sep 2014 05:13:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp274639vcb; Tue, 9 Sep 2014 05:13:10 -0700 (PDT) X-Received: by 10.194.200.74 with SMTP id jq10mr3986331wjc.110.1410264790095; Tue, 09 Sep 2014 05:13:10 -0700 (PDT) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by mx.google.com with ESMTPS id x1si8618056wif.6.2014.09.09.05.13.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 05:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.169 as permitted sender) client-ip=209.85.212.169; Received: by mail-wi0-f169.google.com with SMTP id ex7so935514wid.4 for ; Tue, 09 Sep 2014 05:13:09 -0700 (PDT) X-Received: by 10.194.71.136 with SMTP id v8mr42557266wju.38.1410264789662; Tue, 09 Sep 2014 05:13:09 -0700 (PDT) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id k5sm15243359wiv.21.2014.09.09.05.13.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Sep 2014 05:13:08 -0700 (PDT) From: Daniel Thompson To: Arnd Bergmann Cc: Daniel Thompson , linux-kernel@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Will Deacon , linux-arch@vger.kernel.org Subject: [PATCH] asm-generic/io.h: Implement read[bwlq]_relaxed() Date: Tue, 9 Sep 2014 13:12:40 +0100 Message-Id: <1410264760-29756-1-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently the read[bwlq]_relaxed() family are implemented on every architecture except blackfin, m68k[1], metag, openrisc, s390[2] and score. Increasingly drivers are being optimized to exploit relaxed reads putting these architectures at risk of compilation failures for shared drivers. This patch addresses this by providing implementations of read[bwlq]_relaxed() that are identical to the equivalent read[bwlq](). All the above architectures include asm-generic/io.h . Note that currently only eight architectures (alpha, arm, arm64, avr32, hexagon, microblaze, mips and sh) implement write[bwlq]_relaxed() meaning these functions are deliberately not included in this patch. [1] m68k includes the relaxed family only when configured *without* MMU. [2] s390 requires CONFIG_PCI to include the relaxed family. Signed-off-by: Daniel Thompson Cc: Will Deacon Cc: Arnd Bergmann Cc: linux-arch@vger.kernel.org --- include/asm-generic/io.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 1.9.3 diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 975e1cc..85ea117 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -66,6 +66,16 @@ static inline u32 readl(const volatile void __iomem *addr) return __le32_to_cpu(__raw_readl(addr)); } +#ifndef readb_relaxed +#define readb_relaxed __raw_readb +#endif +#ifndef readw_relaxed +#define readw_relaxed readw +#endif +#ifndef readl_relaxed +#define readl_relaxed readl +#endif + #ifndef __raw_writeb static inline void __raw_writeb(u8 b, volatile void __iomem *addr) { @@ -105,6 +115,10 @@ static inline u64 readq(const volatile void __iomem *addr) return __le64_to_cpu(__raw_readq(addr)); } +#ifndef readq_relaxed +#define readq_relaxed readq +#endif + #ifndef __raw_writeq static inline void __raw_writeq(u64 b, volatile void __iomem *addr) {