All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"marek.vasut@gmail.com" <marek.vasut@gmail.com>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"robh@kernel.org" <robh@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"computersforpeace@gmail.com" <computersforpeace@gmail.com>,
	"frieder.schrempf@exceet.de" <frieder.schrempf@exceet.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/5] spi: spi-mem: Add driver for NXP FlexSPI controller
Date: Mon, 8 Oct 2018 14:32:40 +0200	[thread overview]
Message-ID: <20181008143240.00e784a8@bbrezillon> (raw)
In-Reply-To: <AM2PR04MB1027555CED1534472C6B8A3C99E60@AM2PR04MB1027.eurprd04.prod.outlook.com>

On Mon, 8 Oct 2018 11:21:13 +0000
Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> 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

WARNING: multiple messages have this Message-ID (diff)
From: boris.brezillon@bootlin.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/5] spi: spi-mem: Add driver for NXP FlexSPI controller
Date: Mon, 8 Oct 2018 14:32:40 +0200	[thread overview]
Message-ID: <20181008143240.00e784a8@bbrezillon> (raw)
In-Reply-To: <AM2PR04MB1027555CED1534472C6B8A3C99E60@AM2PR04MB1027.eurprd04.prod.outlook.com>

On Mon, 8 Oct 2018 11:21:13 +0000
Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> 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

  reply	other threads:[~2018-10-08 12:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21 10:21 [PATCH v3 0/5] spi: spi-mem: Add driver for NXP FlexSPI controller Yogesh Gaur
2018-09-21 10:21 ` Yogesh Gaur
2018-09-21 10:21 ` [PATCH v3 1/5] " Yogesh Gaur
2018-09-21 10:21   ` Yogesh Gaur
2018-09-29 15:40   ` Boris Brezillon
2018-09-29 15:40     ` Boris Brezillon
2018-10-01  6:18     ` Frieder Schrempf
2018-10-01  6:18       ` Frieder Schrempf
2018-10-01  6:18       ` Frieder Schrempf
2018-10-01  9:02       ` Yogesh Narayan Gaur
2018-10-01  9:02         ` Yogesh Narayan Gaur
2018-10-01  9:09         ` Boris Brezillon
2018-10-01  9:09           ` Boris Brezillon
2018-10-08 11:21     ` Yogesh Narayan Gaur
2018-10-08 11:21       ` Yogesh Narayan Gaur
2018-10-08 12:32       ` Boris Brezillon [this message]
2018-10-08 12:32         ` Boris Brezillon
2018-09-21 10:22 ` [PATCH v3 2/5] dt-bindings: spi: add binding file " Yogesh Gaur
2018-09-21 10:22   ` Yogesh Gaur
2018-09-27 19:10   ` Rob Herring
2018-09-27 19:10     ` Rob Herring
2018-09-21 10:22 ` [PATCH v3 3/5] arm64: dts: lx2160a: add FlexSPI node property Yogesh Gaur
2018-09-21 10:22   ` Yogesh Gaur
2018-09-21 10:22 ` [PATCH v3 4/5] arm64: defconfig: enable NXP FlexSPI driver Yogesh Gaur
2018-09-21 10:22   ` Yogesh Gaur
2018-09-21 10:22 ` [PATCH v3 5/5] MAINTAINERS: add maintainers for the " Yogesh Gaur
2018-09-21 10:22   ` Yogesh Gaur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181008143240.00e784a8@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frieder.schrempf@exceet.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=robh@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=yogeshnarayan.gaur@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.