Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3523961imm; Mon, 8 Oct 2018 05:33:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV63fZ8Fhrr+NYKmeTXsZQybJFQJ/LCLeeahIgcfQ/g+9HE8wJg6xAC4UeLoZbX+0LHc/LG8P X-Received: by 2002:a63:e40e:: with SMTP id a14-v6mr21032533pgi.28.1539001992614; Mon, 08 Oct 2018 05:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539001992; cv=none; d=google.com; s=arc-20160816; b=u2fXtWRgxa0MP0ZGCV609NdJEZ4+LNNpEux1s9BldmwUP6Mlo9IoSPGhpPVAIQJMf1 AvurEBFThj376UgJwDi6WoYe3rwKWcJPo58tyX9zVqdNiMrR5gQXz9I3cZBLbajDe9YR M+evHXCF+bSnIGb0V3Yxm4MSrlEJADRmu7k2/8GBoMfst7mW2rxpJld0dMFV9geIV5jT GUgMX2r2yesFYXyZvEi1KJbpl4n2wJKvlcMAzx9pGuCDj5iReOP59XxwwE45nZn/1itS loHljCq4pleiwIUt731I4+jlX4zyFAe3MH9IT2IpEPj/H4OxBcjYUWfiLX/eu2uGokRh TcbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=QVEJd2zFa2/pzYwQUL7v+MoLrxGYcu3HrcgXKTOVLQA=; b=OAfXagldoItITuTp3e0L3nNcSUJ714NqirS3h80A45naKPIp6sd08XkOT7dC2X85I7 /Vi8whP+JFvTCQ+avFLc38tOo1x01VBXb0wHgxcXctGcV+F162sbV2eHsXLbC/4V0iP7 KGPjQor4tZYepbbq9/zsHvE68CLcU54edb/9I5PHDov8c0Gp37Tae6T8vi7k8Odpc2dC VZLa8WnBGHizHCvm9kdLD1hHC/Cnu/qddZnHU8gZPdDsY0R9tN++jZ54qrBY1HOCmoGj KF8zrahZLvGEjY0xSMWZLvd8alxyOPR0XN7/+k+QV+yEuaHzW0whJ4eZNF+TfmxhIiH+ xbEw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7-v6si17002833plz.427.2018.10.08.05.32.57; Mon, 08 Oct 2018 05:33:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726180AbeJHToN (ORCPT + 99 others); Mon, 8 Oct 2018 15:44:13 -0400 Received: from mail.bootlin.com ([62.4.15.54]:44268 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725849AbeJHToN (ORCPT ); Mon, 8 Oct 2018 15:44:13 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 28901207F3; Mon, 8 Oct 2018 14:32:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-28-153.w90-88.abo.wanadoo.fr [90.88.148.153]) by mail.bootlin.com (Postfix) with ESMTPSA id CCA6420726; Mon, 8 Oct 2018 14:32:39 +0200 (CEST) Date: Mon, 8 Oct 2018 14:32:40 +0200 From: Boris Brezillon To: Yogesh Narayan Gaur Cc: "linux-mtd@lists.infradead.org" , "marek.vasut@gmail.com" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" , "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "frieder.schrempf@exceet.de" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 1/5] spi: spi-mem: Add driver for NXP FlexSPI controller Message-ID: <20181008143240.00e784a8@bbrezillon> In-Reply-To: References: <1537525323-20730-1-git-send-email-yogeshnarayan.gaur@nxp.com> <1537525323-20730-2-git-send-email-yogeshnarayan.gaur@nxp.com> <20180929174023.51b1e284@bbrezillon> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Oct 2018 11:21:13 +0000 Yogesh Narayan Gaur wrote: > > > +static void nxp_fspi_read_ahb(struct nxp_fspi *f, const struct > > > +spi_mem_op *op) { > > > + u32 len = op->data.nbytes; > > > + > > > + /* Read out the data directly from the AHB buffer. */ > > > + memcpy_fromio(op->data.buf.in, (f->ahb_addr + op->addr.val), len); > > > > Don't know if it's supported, but if it is, I recommend using DMA to do this copy, > > because otherwise you might stall the CPU for quite a long time if the flash is > > operating in a low-speed mode, and RT maintainers will complain about that at > > some point ;-). > > > Read using DMA is not supported by the controller in AHB mode, only supported in IP mode. > Have to use memcpy_fromio() calls. Maximum data size can be read in single call is 0x800 using AHB read. > Still, blocking the CPU until the SPI controller has read 0x800 bytes is enough to make you miss a real-time deadline. Don't you have a controller that supports mem2mem transfers (I'm pretty sure a mem2mem DMA transfer would do the trick here)? Regards, Boris