From: Robin Gong <b38343@freescale.com>
To: Mark Brown <broonie@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
<linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<marex@denx.de>, <shawn.guo@linaro.org>, <Frank.Li@freescale.com>
Subject: Re: [PATCH v5] spi: spi-imx: add DMA support
Date: Thu, 11 Sep 2014 09:37:38 +0800 [thread overview]
Message-ID: <20140911013737.GA366@Robin-OptiPlex-780> (raw)
In-Reply-To: <20140910155216.GI7960@sirena.org.uk>
On Wed, Sep 10, 2014 at 04:52:16PM +0100, Mark Brown wrote:
> On Wed, Sep 10, 2014 at 11:18:01PM +0800, Robin Gong wrote:
> > On Wed, Sep 10, 2014 at 12:45:30PM +0100, Mark Brown wrote:
>
> > > > Yes, you're right. I should use "transfer->tx_sg->sgl == NULL" or
> > > > "transfer->rx_sg->sgl == NULL" instead of usedma flag in driver, right?
>
> > > Right.
>
> > But looks spi core framework can make sure every rx or tx transfer in sequence.
> > If so, can_dma will never be called until this transfer finished
> > (spi_pump_messages), and my usedma flag also never be modified until next
> > transfer start. Please correct me if I am wrong, thanks.
>
> Even if that were true currently this would still not be good code since
> it would break in the face of SPI core changes. In any case the
> assumption isn't true for the current SPI core, the DMA mapping is done
> for all transfers in a message before we start running them and it's
> entirely likely that we will have patterns like a short PIO transfer
> followed by a big data block.
Understood, will improve it in v6.Thanks.
WARNING: multiple messages have this Message-ID (diff)
From: b38343@freescale.com (Robin Gong)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5] spi: spi-imx: add DMA support
Date: Thu, 11 Sep 2014 09:37:38 +0800 [thread overview]
Message-ID: <20140911013737.GA366@Robin-OptiPlex-780> (raw)
In-Reply-To: <20140910155216.GI7960@sirena.org.uk>
On Wed, Sep 10, 2014 at 04:52:16PM +0100, Mark Brown wrote:
> On Wed, Sep 10, 2014 at 11:18:01PM +0800, Robin Gong wrote:
> > On Wed, Sep 10, 2014 at 12:45:30PM +0100, Mark Brown wrote:
>
> > > > Yes, you're right. I should use "transfer->tx_sg->sgl == NULL" or
> > > > "transfer->rx_sg->sgl == NULL" instead of usedma flag in driver, right?
>
> > > Right.
>
> > But looks spi core framework can make sure every rx or tx transfer in sequence.
> > If so, can_dma will never be called until this transfer finished
> > (spi_pump_messages), and my usedma flag also never be modified until next
> > transfer start. Please correct me if I am wrong, thanks.
>
> Even if that were true currently this would still not be good code since
> it would break in the face of SPI core changes. In any case the
> assumption isn't true for the current SPI core, the DMA mapping is done
> for all transfers in a message before we start running them and it's
> entirely likely that we will have patterns like a short PIO transfer
> followed by a big data block.
Understood, will improve it in v6.Thanks.
next prev parent reply other threads:[~2014-09-11 1:37 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-10 1:30 [PATCH v5] spi: spi-imx: add DMA support Robin Gong
2014-09-10 1:30 ` Robin Gong
2014-09-10 4:16 ` Varka Bhadram
2014-09-10 4:16 ` Varka Bhadram
[not found] ` <540FD084.6000805-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-10 5:46 ` Robin Gong
2014-09-10 5:46 ` Robin Gong
2014-09-10 5:46 ` Robin Gong
[not found] ` <1410312604-31949-1-git-send-email-b38343-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-09-10 8:17 ` Arnd Bergmann
2014-09-10 8:17 ` Arnd Bergmann
2014-09-10 8:17 ` Arnd Bergmann
2014-09-10 8:28 ` Robin Gong
2014-09-10 8:28 ` Robin Gong
2014-09-10 8:28 ` Robin Gong
2014-09-10 10:21 ` Mark Brown
2014-09-10 10:21 ` Mark Brown
[not found] ` <20140910102105.GR2601-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-09-10 11:22 ` Robin Gong
2014-09-10 11:22 ` Robin Gong
2014-09-10 11:22 ` Robin Gong
2014-09-10 11:45 ` Mark Brown
2014-09-10 11:45 ` Mark Brown
2014-09-10 11:45 ` Mark Brown
[not found] ` <20140910114530.GD7960-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-09-10 15:18 ` Robin Gong
2014-09-10 15:18 ` Robin Gong
2014-09-10 15:18 ` Robin Gong
2014-09-10 15:52 ` Mark Brown
2014-09-10 15:52 ` Mark Brown
2014-09-10 15:52 ` Mark Brown
2014-09-11 1:37 ` Robin Gong [this message]
2014-09-11 1:37 ` Robin Gong
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=20140911013737.GA366@Robin-OptiPlex-780 \
--to=b38343@freescale.com \
--cc=Frank.Li@freescale.com \
--cc=broonie@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=marex@denx.de \
--cc=shawn.guo@linaro.org \
/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.