linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Rob Landley <rob@landley.net>
Cc: Christoph Hellwig <hch@lst.de>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Rich Felker <dalias@libc.org>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	"open list:IOMMU DRIVERS" <iommu@lists.linux-foundation.org>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux-sh list <linux-sh@vger.kernel.org>
Subject: Re: dmaengine for sh7760 (was Re: use the generic dma-noncoherent code for sh V2)
Date: Fri, 17 Aug 2018 22:23:49 +0200	[thread overview]
Message-ID: <CAK8P3a3x0f_op8PxOaWGNHQ3udg05T6NZggFAd7awns-FoL4yA@mail.gmail.com> (raw)
In-Reply-To: <418f3fa1-036f-d775-f1bc-e96778b4a4d8@landley.net>

On Fri, Aug 17, 2018 at 7:04 PM Rob Landley <rob@landley.net> wrote:
> On 07/31/2018 07:56 AM, Arnd Bergmann wrote:
> > On Fri, Jul 27, 2018 at 6:20 PM, Rob Landley <rob@landley.net> wrote:
> >> On 07/24/2018 03:21 PM, Christoph Hellwig wrote:
> >>> On Tue, Jul 24, 2018 at 02:01:42PM +0200, Christoph Hellwig wrote:
> >>>> Hi all,
> > If you hack on it, please convert the dmaengine platform data to use
> > a dma_slave_map array to pass the data into the dmaengine driver,
>
> The dmatest module didn't need it? I don't see why the ethernet driver would?
> (Isn't the point of an allocator to allocate from a request?)

I guess you have hit two of the special cases here:

- dmatest uses the memory-to-memory DMA engine interface, not the slave
  API, so you don't have to configure a slave at all

- smc91x (and its smc911x.c relative) are apparently special in that they
  use they use the DMA slave API but (AFAICT) require programming
  the dmaengine hardware into a memory-to-memory transfer with no
  DMA slave request signal and completely synchronous operation
  (the IRQ handler polls for the DMA descriptor to be complete),
  see also https://lkml.org/lkml/2018/4/3/464 for the discussion about
  the recent rework of that driver's implementation.

> > mapping the settings from a (pdev-name, channel-id) tuple to a pointer
> > that describes the channel configuration rather than having the
> > mapping from an numerical slave_id to a struct sh_dmae_slave_config
> > in the setup files. It should be a fairly mechanical conversion.
>
> I think all 8 channels are generic. Drivers should be able to grab them and
> release them at will, why does it need a table?
>
> (I say this not having made the smc91x.c driver use this yet, its "conversion"
> to device tree left it full of PXA #ifdefs and constants, and I've tried the

Another point about smc91x is that it only uses DMA on the PXA platform,
which is not part of the "multiplatform" ARM setup. It's likely that no
other platform actually has a DMA engine that can talk to this device in
the absence of a request signal, or that on more modern CPU cores,
a readsl() is actually just as fast, but it avoids the setup cost of talking
to the dma engine. Possibly both of the above.

> last half-dozen kernel releases and qemu releases and have yet to find an arm
> mainstone board under qemu that _doesn't_ time out trying to use DMA with this
> card. But that's another post...)

Is smc91x the only driver that you want to make use of the DMA engine?
I suspect that every other one currently relies on passing a slave ID
shdma_chan_filter into dma_request_slave_channel_compat() or
dma_request_channel() , which are some of the interfaces we want to
remove in the future, to make everything work the same across
all platforms.

shdma_chan_filter() is one of those that expect its pointer argument to
be a number that is in turn associated with an sh_dmae_slave_config
structure in the platform data of the dma engine. What the newer
dma_request_chan() interface does is to pass a pointer to the
slave device and a string as identifier for the same data, which then
gets associated through the dma_slave_map. On smc91x, both
the device and name argument are NULL, which triggers the special
case in the pxa dmaengine driver.

> > The other part I noticed is arch/sh/drivers/dma/*, which appears to
> > be entirely unused, and should probably removed.
>
> I had to switch that off to get this to work, yes. I believe it predates
> dmaengine and was obsoleted by it.

Ok. Have you found any reason to keep it around though?

       Arnd

  reply	other threads:[~2018-08-17 20:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 12:01 use the generic dma-noncoherent code for sh V2 Christoph Hellwig
2018-07-24 12:01 ` [PATCH 1/5] sh: simplify get_arch_dma_ops Christoph Hellwig
2018-07-24 12:01 ` [PATCH 2/5] sh: introduce a sh_cacheop_vaddr helper Christoph Hellwig
2018-07-24 12:01 ` [PATCH 3/5] sh: use dma_direct_ops for the CONFIG_DMA_COHERENT case Christoph Hellwig
2018-07-24 12:01 ` [PATCH 4/5] sh: split arch/sh/mm/consistent.c Christoph Hellwig
2018-07-24 12:01 ` [PATCH 5/5] sh: use generic dma_noncoherent_ops Christoph Hellwig
2018-07-24 20:21 ` use the generic dma-noncoherent code for sh V2 Christoph Hellwig
2018-07-27 16:20   ` Rob Landley
2018-07-30  9:06     ` Christoph Hellwig
2018-07-31 13:25       ` Arnd Bergmann
2018-07-30  9:24     ` Geert Uytterhoeven
2018-07-31 12:56     ` Arnd Bergmann
2018-08-17 17:04       ` dmaengine for sh7760 (was Re: use the generic dma-noncoherent code for sh V2) Rob Landley
2018-08-17 20:23         ` Arnd Bergmann [this message]
2018-08-19  5:38           ` Rob Landley
2018-08-20 12:33             ` Arnd Bergmann

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=CAK8P3a3x0f_op8PxOaWGNHQ3udg05T6NZggFAd7awns-FoL4yA@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=dalias@libc.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jacopo+renesas@jmondi.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=ysato@users.sourceforge.jp \
    /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).