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: 792349 X-Patchwork-Delegate: cyrille.pitchen@atmel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lkLe4wuV"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xDldm10w3z9s76 for ; Sat, 22 Jul 2017 08:23:08 +1000 (AEST) 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-QM; 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=20Le=20Goater?= MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.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(-) 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; }