Re: [PATCH] spi: imx: add module parameter to control DMA use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2019-03-06 at 15:00 +0000, Mark Brown wrote:
> On Wed, Mar 06, 2019 at 09:29:36AM +0100, Uwe Kleine-König wrote:
> > On Mon, Mar 04, 2019 at 11:02:36PM +0000, Trent Piepho wrote:
> > > Add the boolean module parameter "use_dma" to control the use of DMA by
> > > the driver.  There are about two dozen other drivers with a "use_dma"
> > > parameter of some sort.
> > Wouldn't it be more sensible to change the driver to only use DMA for
> > big transfers? That would look much more reasonable than a global
> > parameter that affects all transfers on all spi interfaces. The spi-mxs
> > driver does something like that. (In mxs_spi_transfer_one look for "if
> > (t->len < 32) {".)
> 
> Yes, this is the standard solution and it ensures that things work well
> for people if they just use the driver without knowing the magic
> incanation, and it also avoids issues for devices which do a combination
> of both large and small transfers.

spi imx already does this, switching to PIO if the transfer is less
than the FIFO size.  Assuming future masters don't have huge fifos, the
cpu can likely stuff the fifo, without waiting, faster than it could
setup a dma transfer.

That addresses some of the trade-offs of dma vs pio, but not all. 
There are still other considerations.  From my commit message:

High speed receive operations may be less likely to have issues with
FIFO overflow when using DMA than when using PIO.

The eCSPI appears to insert a 4 bit pause after each word in DMA mode,
not done in PIO mode, which can make DMA transfers 50% slower than PIO.




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux