linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linaro.org>
To: Mark Brown <broonie@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Orson Zhai <orsonzhai@gmail.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	lanqing.liu@unisoc.com, linux-spi@vger.kernel.org,
	DTML <devicetree@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] spi: sprd: Add DMA mode support
Date: Wed, 16 Jan 2019 10:34:05 +0800	[thread overview]
Message-ID: <CAMz4kuKOceVJ9vjq6Z3pZUXSg28RLXHhguJKSvyZPYFLYj_hWw@mail.gmail.com> (raw)
In-Reply-To: <20190115143042.GB5522@sirena.org.uk>

Hi Mark,

On Tue, 15 Jan 2019 at 22:30, Mark Brown <broonie@kernel.org> wrote:
>
> On Tue, Jan 15, 2019 at 09:46:53PM +0800, Baolin Wang wrote:
> > From: Lanqing Liu <lanqing.liu@spreadtrum.com>
> >
> > Add DMA mode support for the Spreadtrum SPI controller, and we will enable
> > SPI interrupt to help to complete the SPI transfer work in DMA mode.
>
> Again this looks good, one thing to check though:
>
> > +static bool sprd_spi_can_dma(struct spi_controller *sctlr,
> > +                          struct spi_device *spi, struct spi_transfer *t)
> > +{
> > +     struct sprd_spi *ss = spi_controller_get_devdata(sctlr);
> > +
> > +     return ss->dma.enable;
> > +}
>
> Is it always a benefit to use DMA?  One reason this is a function rather
> than just a property is that even if the device can DMA any size of
> transfer often for short transfers the performance is better if you use
> PIO since the overhead of setting up the DMA controller, waiting and
> then taking the interrupt when it finishes ends up being more than the
> cost of just reading and writing directly to the FIFOs for PIO.

Firstly we want to simplify the transfer, once we enable the DMA, we
always want to use DMA mode. But I think you are reasonable, we will
optimize the can_dma() ops for short transfers to improve the
performance. Thanks for your comments.

-- 
Baolin Wang
Best Regards

  reply	other threads:[~2019-01-16  2:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 13:46 [PATCH 1/4] spi: sprd: Fix the error data length in SPI read-only mode Baolin Wang
2019-01-15 13:46 ` [PATCH 2/4] spi: sprd: Add the SPI irq function for the SPI DMA mode Baolin Wang
2019-01-15 14:24   ` Mark Brown
2019-01-16  2:21     ` Baolin Wang
2019-01-15 13:46 ` [PATCH 3/4] dt-bindings: spi: Add the DMA properties for the SPI dma mode Baolin Wang
2019-01-21 13:52   ` Rob Herring
2019-01-22  2:22     ` Baolin Wang
2019-01-22  8:11       ` Geert Uytterhoeven
2019-01-22  8:43         ` Baolin Wang
2019-01-15 13:46 ` [PATCH 4/4] spi: sprd: Add DMA mode support Baolin Wang
2019-01-15 14:30   ` Mark Brown
2019-01-16  2:34     ` Baolin Wang [this message]
2019-01-15 19:08 ` Applied "spi: sprd: Fix the error data length in SPI read-only mode" to the spi tree Mark Brown

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=CAMz4kuKOceVJ9vjq6Z3pZUXSg28RLXHhguJKSvyZPYFLYj_hWw@mail.gmail.com \
    --to=baolin.wang@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lanqing.liu@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=orsonzhai@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=zhang.lyra@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).