From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Linux-ALSA <alsa-devel@alsa-project.org>,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
Linux-sh list <linux-sh@vger.kernel.org>,
Vinod Koul <vinod.koul@intel.com>,
Magnus Damm <magnus.damm@gmail.com>,
dmaengine@vger.kernel.org,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
Subject: Re: DMA engine API issue (was: [PATCH/RFC 0/5] R-Car Gen2 DMAC hardware descriptor list support)
Date: Wed, 06 Aug 2014 11:04:40 +0000 [thread overview]
Message-ID: <201408061304.41105.arnd@arndb.de> (raw)
In-Reply-To: <CAMuHMdVz8hNus5x1hn0feqb1SYsUuhA4QHHfPGyebiKLZJwfEQ@mail.gmail.com>
On Wednesday 06 August 2014, Geert Uytterhoeven wrote:
> > I actually have the opposite problem, in my case channels of physically
> > separate DMA engines can be used interchangeably to serve the system's slaves.
> > Using the DMA engine DT bindings, DT nodes of the slaves currently reference a
> > specific DMA engine, even if they can be served by both. This leads to limited
> > dynamic channel allocation capabilities (especially when taking into account
> > lazy channel allocation as mentioned in another mail in this thread).
>
> What about adding a property to the first one, referencing the second
> (or the other way around, don't know what's the easiest to implement)?
>
> dmac0: dma-controller@e6700000 {
> ...
> renesas,alternative = <&dmac1>;
> ...
> };
>
> dmac1: dma-controller@e6720000 {
> ...
> };
>
> That would avoid having to bind a slave device explicitly to a single
> dmac, or having to bind all slave devices to all dmacs.
We have a perfectly fine way to express this with the existing binding
already: you just list channels for both (or more) controllers for each
slave, and let the dma subsystem pick one. This was a compromise we
reached when we initially introduced the dma slave binding, the downside
being that we have to name every reference from a slave to a controller,
even though almost all of them are "rx", "tx" or "data".
I believe what happened though is that the initial implementation in the
kernel was to just pick the first channel for a given name and try that
but give up if it fails. This works for the majority of users and I had
expected someone to implement a smarter strategy as needed.
The easiest way would be to just randomize the order of the channels
during lookup and then try them all, but there is a potential problem
with this failing sometimes in nondeterministic ways.
Another alternative would be for the dma controller to report back
some form of "utilization" number to the dma subsystem and have the
common code pick the least utilized engine that is connected to that
slave.
Arnd
next prev parent reply other threads:[~2014-08-06 11:04 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 12:33 [PATCH/RFC 0/5] R-Car Gen2 DMAC hardware descriptor list support Laurent Pinchart
2014-07-23 2:17 ` Kuninori Morimoto
2014-07-23 10:28 ` Laurent Pinchart
2014-07-23 11:07 ` DMA engine API issue (was: [PATCH/RFC 0/5] R-Car Gen2 DMAC hardware descriptor list support) Laurent Pinchart
2014-07-24 0:46 ` Kuninori Morimoto
2014-07-24 1:35 ` Kuninori Morimoto
2014-07-24 4:59 ` Vinod Koul
2014-07-24 4:58 ` Vinod Koul
2014-08-01 8:51 ` Laurent Pinchart
2014-08-01 14:30 ` Russell King - ARM Linux
2014-08-01 17:21 ` Vinod Koul
2014-08-04 13:47 ` Geert Uytterhoeven
2014-08-04 17:00 ` Laurent Pinchart
2014-08-04 17:54 ` Russell King - ARM Linux
2014-08-05 23:19 ` Laurent Pinchart
2014-08-06 7:17 ` Geert Uytterhoeven
2014-08-06 11:04 ` Arnd Bergmann [this message]
2014-08-01 17:19 ` Vinod Koul
2014-08-04 16:50 ` Laurent Pinchart
2014-08-04 18:03 ` DMA engine API issue Lars-Peter Clausen
2014-08-04 18:32 ` Russell King - ARM Linux
2014-08-04 23:12 ` Laurent Pinchart
2014-08-05 17:08 ` DMA engine API issue (was: [PATCH/RFC 0/5] R-Car Gen2 DMAC hardware descriptor list support) Vinod Koul
2014-07-24 12:29 ` [alsa-devel] DMA engine API issue Lars-Peter Clausen
2014-07-24 12:51 ` DMA engine API issue (was: [PATCH/RFC 0/5] R-Car Gen2 DMAC hardware descriptor list support) Russell King - ARM Linux
2014-08-01 9:24 ` Laurent Pinchart
2014-07-23 9:48 ` [PATCH/RFC 0/5] R-Car Gen2 DMAC hardware descriptor list support Laurent Pinchart
2014-07-23 23:56 ` Kuninori Morimoto
2014-07-24 0:12 ` Laurent Pinchart
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=201408061304.41105.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=alsa-devel@alsa-project.org \
--cc=dmaengine@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=kuninori.morimoto.gx@gmail.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=magnus.damm@gmail.com \
--cc=maxime.ripard@free-electrons.com \
--cc=vinod.koul@intel.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).