From patchwork Fri Jul 21 20:38:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108508 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1248345qge; Fri, 21 Jul 2017 13:39:03 -0700 (PDT) X-Received: by 10.84.210.165 with SMTP id a34mr4424077pli.478.1500669543303; Fri, 21 Jul 2017 13:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500669543; cv=none; d=google.com; s=arc-20160816; b=MpbqX/0qNG0FcL6xPOqGJX119bc0R3XCXPh86EajvLpWkwU3T/hn+RmTkDnvOKLHXR U00BlTntDMZcHgzm0yJKgjfLkTePxEBN0WRKe10PEwnNXPytoZ5gO2pqDcNtGzROV6cy zYfG+roo3UAx40cuPuKLGaLbvh0BsVHQnI2RseZ0+5qg434YrKC/x5FsofPFpEYTDeUQ XWGVr28mlQ5VTFE63ShiB2HPy/fFzeGG1V8AfhVTS+mTdT5oZ/eewSixW+oehNSduQyL udcmaPfVfK+CBzWOxR8d6uSBio/Lz6VfpUpoT4LYaqz7ARrsmMR1culE7F/MGwzAM9p7 qkyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :arc-authentication-results; bh=SorA1lT7UJ2sJPK92xbH11lcTEni1ipwJeYqFoShkK0=; b=mj78Lb2TvuH1sn+s3Gib/WGSiOEWULlK1rBhLlZG6f8r1YFIk1AlPf6sbaadBY1xpH Q1GxnODiNj7j5NNILjT+NPHO7iLBYVzXZ4xPkvmUBgMCdJjwx5hcd6ATuomzWmxzBVG2 SjY9AlOvewQvjyZVL/Ysobq6VYUwiyPsGelYvx4OWryGOeb72IhG0CJUka++MosBdceJ H9md6xYkRggS77M80H5GhcXjlsLUcujgOLfi2on59WNB6rfujKjmWD3XVUUq9gTdwnmt uvYY1qGMV7Z6hZDBA7KkA9nJ7DcwdBi53e6QS2vr6RoPs8oyh2hHWVTLhft4JxrtZPNg deWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.b=t/min/uB; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id k63si3510581pgk.661.2017.07.21.13.39.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jul 2017 13:39:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.b=t/min/uB; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=SorA1lT7UJ2sJPK92xbH11lcTEni1ipwJeYqFoShkK0=; b=t/m in/uBi8uyjVQL2W7XZ/J+lUupZIRXA86A9AQ1EcQ/IVrYPUor1uxjo31SlFS4Qz2WURN3NacoZqPI ymjWOufb00SbWTjPHpOBy/JYvzw+oo5imcN/Qk/OIDbBdMJumyC6JOu7gciG/wQ9i0No2JlXb/rvt KGwfUW/rsLxCqvpMVUTuUfXekqXCD2/agA/TsoA/ldcHrN5wyaGbJEzc65x3cMsHr/xYOCSplYVaS sIuEv88UW4nY7rdgOTqhjnPM3w+SnotqmMN8ac9G14wsPPcR4zlEmEz1vmmcKyHNDfeXH5Ya1OyGX 60Ya9IBO92zgDL7/33pw11BdDWjm7Fg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dYehK-0008C2-CI; Fri, 21 Jul 2017 20:38:54 +0000 Received: from mout.kundenserver.de ([217.72.192.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dYehH-00086z-9F for linux-mtd@lists.infradead.org; Fri, 21 Jul 2017 20:38:53 +0000 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MVd0h-1d6nci2pmZ-00Z33F; Fri, 21 Jul 2017 22:38:19 +0200 From: Arnd Bergmann To: Boris Brezillon , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , Cyrille Pitchen Subject: [PATCH] mtd: orion-nand: fix build error with ARMv4 Date: Fri, 21 Jul 2017 22:38:06 +0200 Message-Id: <20170721203814.3363448-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:T6cYBdFcGzwg40/BBLK+W6XANHTn8xjpfsevEvlUtVW5ZkwEebZ +aGumXFvx+KHwRO60K699+Y3WKW1pm+bG0ySM742mHsh2b2Jbg2kty16E0xCpTrlgta0hg3 Eylu2P+QUqEqX+ZG1uyt5AjrSarUNZVgk836XVJB97WOWZBiCpFUhlNyrAHKVGibHX+vcwN 01PxfqS/z7nE/tqX6m+MA== X-UI-Out-Filterresults: notjunk:1; V01:K0:on7CUUZc8Zo=:h75WajUruFqyP3Uh2PAcZL bfQndnJeBcwPu9kA+P1s25D5hKF6ViWGCGSCHx9cui7pralQqjHwlabcfpRgQhq1kZg8Zgh3e vlZ2EQChgsK8cSGZEtOeZHBxeTF93kLkctutUSM0R0Cz001+gbtQdrASQDVR3QCn9X70UBoOp gGZwdkqWg8C2GZ1MAewH3qysuNHr3uesJmr8r32lScBEN8S5faOGwk68VDyfgSfL/nK5oWtQU rYMrcFYhykGeSbgg3TasEL80xk1GqsMl8IyN1NPaVeHDRFpKScavg0pS2uQHgsUDL6Tfstinc 0aqII0npxb74NcMSaELXDC43TAoeOcZ4Y8bWt+leWBlF8jUG06X6RFYJXsJ3IEWshjLiAiREU N1AGqNqsx7b1EoE69wzZpH3h0ffC9+ckSEKzg0v5ht1l9/QXya2PpQYOYF2JK8yEeBfY3RUan mYDNu7sxfksxrJPDlJQ8K1XHKyUHRwwg/xriQZFDk5jHRPWTgzB3lXYEjja9y+izBVT1vD3eV P7+cEDzGb7T+J2G7qjHMCoiOuMxvgf3UTzeyhyyXZWnQ3ed9cgDMmnXZA+mRG6Tef9GTjJ0zP +dM9cBxqOXLbTJHZq6NskEF+GZYQA7XTCkX1O2hVFYSkrVrp/ddLqay9QXaLkr9Cg9ge46Ke2 h/AZsbJMP6/CpzX+1izZNeS+Z9/9Hzdpc0P6xSvVp/LkPWDKW4TsJu966ioUhtu11uvQIvh1z JfC60zU4WjRZ3yD7Ux9x30eWTgFqfABNUn36Bw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170721_133851_692741_CD2A7AAB X-CRM114-Status: GOOD ( 11.56 ) X-Spam-Score: -4.7 (----) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-4.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [217.72.192.74 listed in list.dnswl.org] -2.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.72.192.74 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Simon Baatz , Arnd Bergmann , Jingoo Han , linux-kernel@vger.kernel.org, Masahiro Yamada , linux-mtd@lists.infradead.org, Arvind Yadav MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org orion_nand_read_buf uses an inline assembly with the "ldrd" instruction, which is only available from ARMv5 upwards. This used to be fine, since all users have an ARMv5 or ARMv7 CPU, but now we can also build a multiplatform kernel with ARMv4 support enabled in addition to the "kirkwood" (mvebu) platform. This provides an alternative to call the readsl() function that is supposed to have the same effect and is also optimized for performance. I first posted a version of this patch back in 2014, and there was some discussion about it then. This fixes the bugs identified back then and should be a reasonable alternative for the rare corner case. Link: https://patchwork.kernel.org/patch/4144791/ Cc: Jingoo Han Signed-off-by: Arnd Bergmann --- drivers/mtd/nand/orion_nand.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.9.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index 209170ed2b76..41cb7acfc044 100644 --- a/drivers/mtd/nand/orion_nand.c +++ b/drivers/mtd/nand/orion_nand.c @@ -54,13 +54,16 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) { struct nand_chip *chip = mtd_to_nand(mtd); void __iomem *io_base = chip->IO_ADDR_R; +#if __LINUX_ARM_ARCH__ >= 5 uint64_t *buf64; +#endif int i = 0; while (len && (unsigned long)buf & 7) { *buf++ = readb(io_base); len--; } +#if __LINUX_ARM_ARCH__ >= 5 buf64 = (uint64_t *)buf; while (i < len/8) { /* @@ -74,6 +77,10 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) buf64[i++] = x; } i *= 8; +#else + readsl(io_base, buf, len/4); + i = len / 4 * 4; +#endif while (i < len) buf[i++] = readb(io_base); }