linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 1/6 v5] dmaengine: rcar-audmapp: independent from SH_DMAE_BASE v1
Date: Thu, 15 Oct 2015 13:38:02 +0000	[thread overview]
Message-ID: <6339568.5jUx9m7nQC@avalon> (raw)
In-Reply-To: <87wq4ib4xw.wl%kuninori.morimoto.gx@renesas.com>

Hi Arnd,

Revisiting this old topic.

On Friday 23 January 2015 14:16:38 Arnd Bergmann wrote:
> On Thursday 22 January 2015 23:25:49 Laurent Pinchart wrote:
> > Actually the R-Car platforms suffer from the same multiplexing issue. We
> > have decided to implement a new R-Car DMAC driver due to the complexity
> > of adding new features to the existing code base, aiming at a "start
> > clean from scratch" approach.
> > 
> > Multiplexing isn't supported by the new driver. How to implement that
> > properly will need to be discussed when and if needed.
> 
> Ok, I see. Do these chips also multiplex between dma engine instances
> with different drivers, or only between similar dma engine IP blocks?

Only between different instances of the same IP core.

> When we created the generic dmaengine binding, we intentionally
> mandated the use of dma-names do allow you specify multiple connections
> in one property, and if they have the same name, the dmaengine core
> should be free to pick any of them.
> 
> I believe this was never implemented in Linux though, so the dmaengine
> core picks the first one with a matching name and does not try any
> others when it fails. We would need to come up with a good policy to
> decide in which order to try the channels, but implementing any scheme
> should not be too hard.

The biggest problem I see there is when to decide on channel allocation. The 
current DMA engine API expects association between slaves and DMA engines to 
be decided at channel request time. However, drivers usually request channels 
at probe time, even if they rarely use the channels. We end up with resources 
being allocated and held when they could really be shared. The virtual DMA 
channels API tries to fix that but doesn't push back allocation to usage time.

How should we fix that ? And more importantly, is it worth fixing ? It looks 
like pretty much everybody works around the issue on platforms where the 
number of slaves exceeds the number of channels.

> The current shdma multiplexing driver with the "renesas,shdma-mux" binding
> implements a different scheme, but also incomplete: The binding documents
> that it multiplexes between the dmaengine devices that are children of
> the mux. The driver instead multiplexes between all dmaengine devices
> that are registered through shdma_init() regardless of their location
> in DT. Apparently this resulted in the correct behavior for all the
> traditional SoCs on which all the dmaengines are multiplexed together,
> but it broke for the r-car audmapp that is not multiplexed in the same
> way.

I don't really like that implementation given that it uses DT to describe a 
virtual mux. For platforms where the number of DMA engines is low (such as R-
Car where we have two system DMA engines) I think listing possible channels 
explicitly in DT should be fine. If we had a high number of interchangeable 
DMA engines it would be another story.

-- 
Regards,

Laurent Pinchart


      parent reply	other threads:[~2015-10-15 13:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20  1:44 [PATCH 1/6 v5] dmaengine: rcar-audmapp: independent from SH_DMAE_BASE v1 Kuninori Morimoto
2015-01-20 13:59 ` Arnd Bergmann
2015-01-21  1:25 ` Kuninori Morimoto
2015-01-21 14:19 ` Arnd Bergmann
2015-01-22  7:04 ` Kuninori Morimoto
2015-01-22 21:25 ` Laurent Pinchart
2015-01-23 13:16 ` Arnd Bergmann
2015-10-15 13:38 ` Laurent Pinchart [this message]

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=6339568.5jUx9m7nQC@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-sh@vger.kernel.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 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).