dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: <robh+dt@kernel.org>, <dmaengine@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <dan.j.williams@intel.com>,
	<devicetree@vger.kernel.org>
Subject: Re: [RFC 1/3] dt-bindings: dma: Add documentation for DMA domains
Date: Fri, 13 Sep 2019 10:21:47 +0300	[thread overview]
Message-ID: <1992ccdd-78b3-f248-3d4d-76b5e6d4cb37@ti.com> (raw)
In-Reply-To: <20190912170312.GD4392@vkoul-mobl>



On 12/09/2019 20.03, Vinod Koul wrote:
> On 09-09-19, 09:30, Peter Ujfalusi wrote:
> 
>>>> or domain-dma-controller?
>>>
>>> I feel dma-domain-controller sounds fine as we are defining domains for
>>> dmaengine. Another thought which comes here is that why not extend this to
>>> slave as well and define dma-domain-controller for them as use that for
>>> filtering, that is what we really need along with slave id in case a
>>> specific channel is to be used by a peripheral
>>>
>>> Thoughts..?
>>
>> I have thought about this, we should be able to drop the phandle to the
>> dma controller from the slave binding just fine.
>>
>> However we have the dma routers for the slave channels and there is no
>> clear way to handle them.
>> They are not needed for non slave channels as there is no trigger to
>> route. In DRA7 for example we have an event router for EDMA and another
>> one for sDMA. If a slave device is to be serviced by EDMA, the EDMA
>> event router needs to be specified, for sDMA clients should use the sDMA
>> event router.
> 
> So you have dma, xbar and client? And you need to use a specfic xbar,
> did i get that right?

At the end yes.
EDMA have dedicated crossbar
sDMA have dedicated crossbar

Slave devices must use the crossbar to request channel from the DMA
controllers. Non slave request are directed to the controllers directly
(no DT binding).

At minimum we would need a new property for DMA routers.
dma-domain-router perhaps which is pointing to the xbar.

A slave channel request would first look for dma-domain-router, if it is
there, the request goes via that.
If not then look for dma-domain-controller and use it for the request.
The DMA binding can drop the phandle to the xbar/dma.

Request for not slave channel would only look for dma-domain-controller.

But...

- If we have one dedicated memcpy DMA and one for slave usage.
In top we declare dma-domain-controller = <&m2m_dma>;

Then you have  a slave client somewhere
client1: peripheral@42 {
	dma-domain-controller = <&slave_dma>;
	dmas = <6>, <7>;
	dma-names = "tx", "rx";
};

This is fine I guess. But what would we do if the driver for client1
needs additional memcpy channel? By the definition of the binding the
non slave channel should be taken from the closest dma-domain-controller
which is not what we want. We want the channel from m2m_dma.

And no, we can not start looking for the dma-domain-controller starting
from the root as in most cases the dma-domain-controller closer to the
client is what we really want and not the globally best controller.

- How to handle the transition?
If neither dma-domain-controller/router is found, assume that the first
argument in the binding is a phandle to the dma/router?
We need to carry the support for what we have today for a long time. The
kernel must boot with old DT blob.

- Will it make things cleaner? Atm it is pretty easy to see which
controller/router is used for which device.

- Also to note that the EDMA and sDMA bindings are different, so we can
not just swap dma-domain-controller/router underneath, we also need to
modify the client's dmas line as well.

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

  reply	other threads:[~2019-09-13  7:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 14:18 [RFC 0/3] dmaengine: Support for DMA domain controllers Peter Ujfalusi
2019-09-06 14:18 ` [RFC 1/3] dt-bindings: dma: Add documentation for DMA domains Peter Ujfalusi
2019-09-08  7:47   ` Peter Ujfalusi
2019-09-08 12:10     ` Vinod Koul
2019-09-09  6:30       ` Peter Ujfalusi
2019-09-12 17:03         ` Vinod Koul
2019-09-13  7:21           ` Peter Ujfalusi [this message]
2019-09-13 10:36             ` Vinod Koul
2019-09-13 12:19               ` Peter Ujfalusi
2019-09-13 13:33                 ` Vinod Koul
2019-09-08 12:06   ` Vinod Koul
2019-09-09  6:00     ` Peter Ujfalusi
2019-09-06 14:18 ` [RFC 2/3] dmaengine: of_dma: Function to look up the DMA domain of a client Peter Ujfalusi
2019-09-08 12:12   ` Vinod Koul
2019-09-06 14:18 ` [RFC 3/3] dmaengine: Support for requesting channels preferring DMA domain controller Peter Ujfalusi
2019-09-08  7:46   ` Peter Ujfalusi
2019-09-08 12:15   ` Vinod Koul
2019-09-09  5:56     ` Peter Ujfalusi
2019-09-12 16:49       ` Vinod Koul
  -- strict thread matches above, loose matches on Subject: below --
2019-09-06 14:17 [RFC 0/3] dmaengine: Support for DMA domain controllers Peter Ujfalusi
2019-09-06 14:17 ` [RFC 1/3] dt-bindings: dma: Add documentation for DMA domains Peter Ujfalusi

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=1992ccdd-78b3-f248-3d4d-76b5e6d4cb37@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=dan.j.williams@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=vkoul@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).