From patchwork Fri Jul 21 22:21:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108517 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1338231qge; Fri, 21 Jul 2017 15:23:02 -0700 (PDT) X-Received: by 10.98.11.4 with SMTP id t4mr8930796pfi.104.1500675782112; Fri, 21 Jul 2017 15:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500675782; cv=none; d=google.com; s=arc-20160816; b=Tn7/WfdRJkYgCSyFLHxE0Qb8S4i2zm3Cw8bTSxmnjCQdh9RSvdRzU00E8XJDVLWgdG qCd5HhQMqkmr/nemkZXLww3cUey6/jEMqKpKmnDyfWD+igZh6oeJ/XGQn4o9j/V6Kw1w 9F3rVwrgOsZsZXqlZNEQoR/tZfGtaAuE33me5j7/8KUsIFm7nNaanhBCeOjOFrLgrIns Mz02pKKLLkweGwXW1JUQCRU0fk+VwxrLRNBqPLNEjRzRvj7l9lPYffwUA7W/rXr7uEln blwbdr/dnjfQWeWcwG/W70wBmbmShihBOTNAMMe8FWj2mBNxF/vDX927UEqCqZoPokXC UGbg== 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=4fokkIsXkmmfs00zADjry9hxbky9ApoTy7QYzmGMAW4=; b=Ewve+WPla0OL5M0nK4ludD5gQnx5n0T0dfw65EHfwGlhBmJjacjWxkxpIIRqLy9o6W o3/9BeKgXVjT1gZY4NXDtUHik0bdK4G3mB/NBc0ZscgSdbbFJ9wqziIPFZWHkPKMBtEQ BpNM9mFZ8Du/dbCMAdiKI3GOS9Ki7mVOIXajBugbP+z5iGSEgjRYDJy0IHR2DS6ETl2N A6cE2eJ6lZnisXgJcne/1KI7ZUKNy5MVJAWW6nARLokqPuRHlH2nlFKValiGREMTcIe/ /G3iAj76131MX7QSn7RYVw8wASCtrBzyQXLO1mnUlkvWbyQJTJb6kwyxBcRBfX2Wsayl eXTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.b=lkLe4wuV; 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 l5si3624739pgn.761.2017.07.21.15.23.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jul 2017 15:23:02 -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=lkLe4wuV; 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=4fokkIsXkmmfs00zADjry9hxbky9ApoTy7QYzmGMAW4=; b=lkL e4wuV4lXmEP0O4Iow7p1n7GL4qLxrgEFCrfK6Fm5lde6LWak7685T4Wr70ALKjWtZnZMBLtnKCGIk iaFowl41/PcJbEp77qUpmiRXcXlqSE1eze2K+ZoA3N7j+ooQmlziDrZX4IK7bocaHMr54zPv86YwC qM9on14p8uO32tnOsUpd1HU46yKixWLB5dsFkVPY98StZ4AxtUXGLAgntciEU0cG55Fo+vjTZak0n qxK8YDYsMKpsc2xTCtCCS/VuRqHBEcKfTTsr7hKPF0KmrsAk2UekwxgANyvX4OerPz9awM944uBs8 SHJJgBjNpKlmRPHPja2HtckQNKG0VhA==; 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 1dYgJx-0004Xv-O0; Fri, 21 Jul 2017 22:22:53 +0000 Received: from mout.kundenserver.de ([217.72.192.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dYgJu-0004XN-SY for linux-mtd@lists.infradead.org; Fri, 21 Jul 2017 22:22:53 +0000 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0M3jlp-1dqcng2ePZ-00rI0h; Sat, 22 Jul 2017 00:22:09 +0200 From: Arnd Bergmann To: Cyrille Pitchen , Marek Vasut , David Woodhouse , Brian Norris , Boris Brezillon , Richard Weinberger Subject: [PATCH] [RFC] mtd: atmel-quadspi: fix build issues Date: Sat, 22 Jul 2017 00:21:54 +0200 Message-Id: <20170721222204.3402340-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:1o2m7oKYs+GM4WfFfWqKMe5PuMauLJvbKcX25EX1VTKPVfYEwh2 r9f9hiuCyPTdrjoQA2pff0ilO8jok3179Ygj+dJ+KZZZe8QV/WvOq7TDctozXPWtmsuV627 ClfnbPvwgnPfRiAwEANQJ/KvBckmNv8Kt25Y0W+0QyAlIijU5qjfsAsucvkgAKFnXHmxp0K zSLDz8mo5CQtPwYS/wI3Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:TxvmlWyi6CM=:jZSYdlcbA+yZfGYC2dw9f/ ABlJtjFWDR9FD9JoO4y43ECIocJymbH6VcDsCwRlkBwh5txv7m3v/ufYfbkCrUPBb2xdVmE93 xtX1U8Z4UXatcgUbVJtlM0wOznG3jcqQs5c2AmPfVgfjCvlN6D7+pEFW7RwF3K840vCi4GzPv Ump9bjaMS0iphWlYJm53UsLmVPv04aL6AMR4x4VWHNsTJqfu3hhOOF8lvoCidjO26ENSsRZRS dB5QcSuKro4BjuEGf73yEUlEYUdXAI067FhIp4IBwC3B/WvaTb863f1+AtgNH3QVEu2eAS0rc Sp0mOs9lUWOKyQaf+G2lpCK5f+y+LXnJFkxKdsvwoAC4r28d+2GAJnl37c67vFz8V9w7RLKdQ jZUTh24/CcU+EYchqlnA9rks8AeDz9dV2zqpZCgEkzo1ThyyXtlQGH0QMAPyPPEmPb9ljV794 WkG8rK4a7iJmvAc1mfRtU9JttEeQQOUixY5cBjioaRFM1mPKXE3ZBCTYl6gjzqNH3DUb7TFOV dzwSxSkGT7ZPDB+7KtIB64gTtqfPFfhrDtuMJUxj7tjMrWo9A3rBu6TFbJ0mL8phlquEBdlv+ tYjL0XejGuivA5KMXJPGC+gSK0gvgqgfd0UUZRCCLamQdRH2DwhMPBlwR5+YvKml0AKhrTOOk jXRr8MyMQxtdlHntnzAuhHzGplqsBmkIAeSLrGNZaOflK85oVptyxr2W1jmoMwu+0+9al6rLA 1gZ7CAs2o5zz9hctvgRl2VNLlkhzn3P9CJK3vQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170721_152251_291473_B1092C40 X-CRM114-Status: GOOD ( 14.38 ) 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: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Joel Stanley , Mika Westerberg , Ludovic Barre , =?utf-8?q?C=C3=A9dric_Le_Goater?= MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org I ran into a link-time error with the atmel-quadspi driver on the EBSA110 platform: drivers/mtd/built-in.o: In function `atmel_qspi_run_command': :(.text+0x1ee3c): undefined reference to `_memcpy_toio' :(.text+0x1ee48): undefined reference to `_memcpy_fromio' The problem is that _memcpy_toio/_memcpy_fromio are not available on that platform, and we have to prevent building the driver there. A related problem is that the functions are not portable APIs and should not be called directly from a device driver. On little-endian machines, the regular memcpy_toio/memcpy_fromio functions are defined as optimized versions using multi-byte transfers that are much faster. Cyrille mentioned that initially using memcpy_toio/memcpy_fromio did not work, but I suspect that this was the result of a bug that has since been fixed. With that change, we can also compile-test on other architectures. Link: http://lists.infradead.org/pipermail/linux-mtd/2016-July/068583.html Fixes: 161aaab8a067 ("mtd: atmel-quadspi: add driver for Atmel QSPI controller") Signed-off-by: Arnd Bergmann --- drivers/mtd/spi-nor/Kconfig | 2 +- drivers/mtd/spi-nor/atmel-quadspi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig index 293c8a4d1e49..22e5fc4080f8 100644 --- a/drivers/mtd/spi-nor/Kconfig +++ b/drivers/mtd/spi-nor/Kconfig @@ -41,7 +41,7 @@ config SPI_ASPEED_SMC config SPI_ATMEL_QUADSPI tristate "Atmel Quad SPI Controller" - depends on ARCH_AT91 || (ARM && COMPILE_TEST) + depends on ARCH_AT91 || (COMPILE_TEST && !ARCH_EBSA110) depends on OF && HAS_IOMEM help This enables support for the Quad SPI controller in master mode. diff --git a/drivers/mtd/spi-nor/atmel-quadspi.c b/drivers/mtd/spi-nor/atmel-quadspi.c index ba76fa8f2031..ff3849106e77 100644 --- a/drivers/mtd/spi-nor/atmel-quadspi.c +++ b/drivers/mtd/spi-nor/atmel-quadspi.c @@ -208,9 +208,9 @@ static int atmel_qspi_run_transfer(struct atmel_qspi *aq, if (cmd->enable.bits.address) ahb_mem += cmd->address; if (cmd->tx_buf) - _memcpy_toio(ahb_mem, cmd->tx_buf, cmd->buf_len); + memcpy_toio(ahb_mem, cmd->tx_buf, cmd->buf_len); else - _memcpy_fromio(cmd->rx_buf, ahb_mem, cmd->buf_len); + memcpy_fromio(cmd->rx_buf, ahb_mem, cmd->buf_len); return 0; }