From: Stephen Warren <swarren@wwwdotorg.org>
To: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Stephen Warren <swarren@nvidia.com>,
Benoit Cousson <b-cousson@ti.com>,
device-tree <devicetree-discuss@lists.ozlabs.org>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Rob Herring <rob.herring@calxeda.com>,
Grant Likely <grant.likely@secretlab.ca>,
Jon Hunter <jon-hunter@ti.com>,
Russell King <linux@arm.linux.org.uk>,
linux-omap <linux-omap@vger.kernel.org>,
linux-arm <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH V3 1/2] of: Add generic device tree DMA helpers
Date: Fri, 11 May 2012 13:28:08 -0600 [thread overview]
Message-ID: <4FAD6848.40700@wwwdotorg.org> (raw)
In-Reply-To: <CAJe_ZhduQuHnFyF20VnjZW9uz1szwL6O7=ow+tMqanmeHs58pQ@mail.gmail.com>
On 05/10/2012 01:59 PM, Jassi Brar wrote:
> On 10 May 2012 22:30, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 05/09/2012 03:38 PM, Jassi Brar wrote:
>
>>> One point is about 'qos' here.... something like bandwidth allocation.
>>> If the dmac driver knew up-front the max possible clients that could be
>>> active simultaneously, it could "divide the bandwidth" accordingly.
>>> Again, the example of PL330 employing 2physical channels for better
>>> service - LLI (you got it right), where even 1 physical channel would
>>> also have served only not as reliably. I believe there would be
>>> more such scenarios.
>>
>> QoS seems like policy to me, whereas DT is more about describing the HW.
>> Is DT the correct place to describe QoS policy?
>>
>> I guess you are talking more about deriving policy from the description
>> of HW, i.e. how many client described in DT.
>
> Yeah, that's what I meant.
>
>> However, for some reason that seems dangerous to me; what if clients
>> can be instantiated some other way?
>
> The other way could be hotplug ?
Yes. Also, there's probably some mix of DT-driven and non-DT-driven
instantiation during the transition to DT, although that's probably
temporary.
> Anyway in those machines every channel would be populated
> and dmac driver would always account for the all-ports-plugged case.
>
>> For a 1:1 mapping (or 1:n mapping in HW with static selection specified
>> in the DT) between DMA client and DMA controller, perhaps the controller
>> can indeed make QoS decisions based on which (how many) clients are
>> connected to it.
>>
>> However, if a DMA client can be serviced by more than 1 DMA engine, and
>> the decision as to which DMA engine to use occurs at run-time by the DMA
>> driver core, rather than being statically configured in the DT, then the
>> DMA controller drivers cannot know ahead of time which will be used
>
> I think the dmac driver would make use of the routing flexibility to sustain its
> 'qos', and not the other way around (decide qos based on which one of the
> two dmacs would provide a channel to a client in future).
> Anyways, so far only Samsung SoCs seem to have that flexibility/redundancy
> and I have never had anyone asking for that runtime decision making.
>
>>> The minor difference being, you use the {request-signal, phandle} pair
>>> to find the right channel, I used only 'token'.
>>
>> That's a pretty big difference, I think.
>>
>> In your proposal, every token was globally unique (well, within the 1 DT
>> file). I'd rather not see any more global numbering schemes.
>
> Probably my shallow experience, but "globally unique, within a file" sounds
> like an oxymoron :)
To the kernel, that one file describes everything it knows about the HW
(except for probed information), so it's global:-) Aside from that, I've
often seen the term "global" used relative to some specific scope.
> I think arbitrary numerical tokens are a reasonable price to pay for the
> robustness and simplicity they bring.
I have to disagree here.
Using phandle+ID is almost as simple, and much more flexible. Global IDs
have a number of disadvantages:
a) You have to somehow keep them unique. Even with just a single .dts
file, that's going to be a little painful since there's no central table
of these IDs.
What if the DT is composed of a bunch of chunks that represent pluggable
boards, which may be mixed/matched together depending on what the user
actually plugged in? Then, you have to be very careful to keep the n
different files' numbering ranges segregated, or conflicts will occur.
b) Everything else in DT already uses phandle+ID, so doing the same
thing would be much more familiar and consistent for DT users.
>> Now, DMA requests are signals /from/ a DMA client to a DMA controller
>> ("send more data please", or "pull more data please"). Hence, I assert
>> that the phandle should refer to the DMA client, not the DMA controller.
>
> OK, though we may just want to convey information about the h/w setup
> from the s/w POV, rather than info to simulate the h/w ;)
DT is specifically about describing the HW from a HW perspective.
> For ex, the dma api and controller drivers don't really care about
> the fact that the client's driver must set some bit to trigger operation,
> whereas some simulator would need to care about that.
>
> Anyways, I am OK with whatever works well and make things simpler.
>
>>> Also note that, a client's dma specifier becomes perfectly general
>>> and future-proof
>>>
>>> client1: spdif {
>>> dma_tx = <278>
>>> dma_rx = <723>
>>> };
>>>
>>> otherwise the following representation
>>>
>>> client1: spdif {
>>> dma = <&sdma 2 1 &sdma 3 2>;
>>> };
>>>
>>> could break with some weird dma setups (IIANW Russell already finds
>>> it wouldn't work for him).
>>
>> To solve Russell's HW, we need some way of representing the mux directly
>> in DT irrespective of how the DMA controller or DMA client specify what
>> they're connected to. Anything else isn't representing the HW in DT.
>>
>> Also, who knows how to control the mux? We need that to be fully
>> general, and so the mux itself really needs some kind of driver which
>> the DMA core or DMA controller can call into when the channel is
>> allocated in order to set up the mux. Right now, Russell's driver calls
>> in the a platform-/board-provided callback, but we should really
>> architect a generic driver framework for this.
>
> Well, I doubt if there would ever be enough such platforms to warrant a
> new generic framework. For now, I would leave that to be a matter between
> the dmac driver and its DT node.
>
> Similarly let every dmac, being unique, require DT data in it's own custom
> format - I don't believe we can find a generic DT format for every kind of
> dmac that does exist or would exist. (For ex, you found a way for RMK's
> mux'ed req_lines, but what about assigning priorities to clients which is
> possible with PL08X dmacs but not most others?)
Good question. Again thought that sounds a little like policy, so
perhaps should be negotiated at runtime rather than described in DT?
> So, I would strive only to make clients' dma specifier generic.
>
>> client0: i2s {
>> /* has 2 DMA request output signals: 0, 1 */
>> };
>>
>> client1: spdif {
>> /* has 2 DMA request signals: 0, 1 */
>> };
>>
> Do we also need to somehow tag these signals for the client to
> differentiate between TX and RX channel ?
Yes, the client's DT binding would certainly need to describe how many
DMA request signals its HW generates, and give a unique ID to each. The
driver would need to request a DMA channel for a specific one of its DMA
requests.
next prev parent reply other threads:[~2012-05-11 19:28 UTC|newest]
Thread overview: 129+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-30 21:17 [PATCH V3 1/2] of: Add generic device tree DMA helpers Jon Hunter
2012-05-03 22:26 ` Stephen Warren
[not found] ` <4FA30604.1030401-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-05-03 23:25 ` Russell King - ARM Linux
2012-05-04 12:39 ` Arnd Bergmann
2012-05-04 15:06 ` Jon Hunter
[not found] ` <4FA3F08D.7030603-l0cyMroinI0@public.gmane.org>
2012-05-04 15:14 ` Russell King - ARM Linux
2012-05-04 18:21 ` Stephen Warren
2012-05-04 19:19 ` Jon Hunter
2012-05-04 6:56 ` Jassi Brar
2012-05-04 15:17 ` Jon Hunter
2012-05-04 19:01 ` Jassi Brar
2012-05-04 19:23 ` Arnd Bergmann
2012-05-05 17:10 ` Jassi Brar
2012-05-07 15:53 ` Stephen Warren
2012-05-07 17:19 ` Jassi Brar
2012-05-08 16:35 ` Stephen Warren
2012-05-08 19:09 ` Jassi Brar
2012-05-09 12:30 ` Arnd Bergmann
2012-05-09 19:10 ` Stephen Warren
2012-05-09 21:38 ` Jassi Brar
2012-05-10 17:00 ` Stephen Warren
2012-05-10 19:59 ` Jassi Brar
2012-05-11 19:28 ` Stephen Warren [this message]
2012-05-11 21:06 ` Jassi Brar
2012-05-11 23:51 ` Stephen Warren
2012-05-12 13:40 ` Jassi Brar
2012-05-16 1:05 ` Jon Hunter
2012-05-17 13:18 ` Russell King - ARM Linux
2012-05-07 17:21 ` Arnd Bergmann
2012-05-16 1:11 ` Jon Hunter
2012-05-16 12:37 ` Jassi Brar
2012-05-16 13:15 ` Jon Hunter
2012-05-16 15:44 ` Stephen Warren
2012-05-16 16:04 ` Jon Hunter
2012-05-16 16:01 ` Jon Hunter
2012-05-16 16:15 ` Stephen Warren
2012-05-16 16:22 ` Jassi Brar
2012-05-16 17:09 ` Jon Hunter
2012-05-16 19:42 ` Arnd Bergmann
2012-05-16 21:16 ` Jassi Brar
2012-05-17 19:32 ` Stephen Warren
2012-05-18 17:12 ` Jassi Brar
2012-05-18 21:04 ` Arnd Bergmann
2012-05-16 23:59 ` Stephen Warren
2012-05-17 4:05 ` Jassi Brar
2012-05-18 20:49 ` Arnd Bergmann
2012-05-18 21:07 ` Stephen Warren
2012-05-18 21:43 ` Arnd Bergmann
2012-05-18 22:20 ` Stephen Warren
2012-05-19 8:44 ` Arnd Bergmann
2012-05-21 17:33 ` Stephen Warren
2012-05-21 18:18 ` Arnd Bergmann
2012-05-21 20:32 ` Stephen Warren
2012-06-08 19:04 ` Jon Hunter
2012-06-09 0:04 ` Arnd Bergmann
2012-06-13 22:32 ` Jon Hunter
2012-06-14 4:45 ` Jassi Brar
2012-06-14 11:48 ` Arnd Bergmann
2012-06-14 15:39 ` Jon Hunter
2012-06-15 8:40 ` Arnd Bergmann
2012-06-22 22:52 ` Jon Hunter
[not found] ` <4FE4F718.3080204-l0cyMroinI0@public.gmane.org>
2012-06-22 23:12 ` Russell King - ARM Linux
2012-06-25 16:51 ` Jon Hunter
2012-06-25 18:04 ` Vinod Koul
2012-06-25 20:30 ` Arnd Bergmann
2012-06-26 9:40 ` Vinod Koul
2012-06-26 14:59 ` Arnd Bergmann
2012-06-26 17:50 ` Vinod Koul
2012-06-26 20:27 ` Arnd Bergmann
2012-06-27 13:45 ` Vinod Koul
2012-06-27 15:20 ` Arnd Bergmann
2012-07-13 6:45 ` Vinod Koul
2012-07-13 21:52 ` Guennadi Liakhovetski
2012-07-17 19:24 ` Arnd Bergmann
2012-07-20 4:00 ` Vinod Koul
2012-07-20 8:39 ` Arnd Bergmann
2012-07-20 9:37 ` Vinod Koul
2012-07-24 19:07 ` Jon Hunter
2012-07-24 19:27 ` Arnd Bergmann
2012-07-26 6:42 ` Vinod Koul
2012-07-26 7:14 ` Arnd Bergmann
2012-07-26 11:28 ` Vinod Koul
2012-07-26 15:53 ` Jon Hunter
[not found] ` <5011680A.6040400-l0cyMroinI0@public.gmane.org>
2012-07-31 11:06 ` Vinod Koul
2012-07-26 17:43 ` Jon Hunter
2012-07-31 11:12 ` Vinod Koul
2012-08-01 20:43 ` Jon Hunter
2012-08-03 9:55 ` Vinod Koul
2012-07-20 9:08 ` Robert Jarzmik
2012-07-20 9:41 ` Vinod Koul
2012-07-26 4:56 ` zhangfei gao
2012-07-23 21:29 ` Stephen Warren
2012-07-24 7:19 ` Arnd Bergmann
2012-07-24 16:04 ` Stephen Warren
2012-07-24 18:55 ` Arnd Bergmann
2012-07-24 12:54 ` Sergei Shtylyov
2012-07-06 11:36 ` Guennadi Liakhovetski
[not found] ` <Pine.LNX.4.64.1207061315470.29809-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2012-07-06 15:28 ` Arnd Bergmann
[not found] ` <201207061528.58291.arnd-r2nGTMty4D4@public.gmane.org>
2012-07-06 15:43 ` Guennadi Liakhovetski
2012-07-06 17:31 ` Arnd Bergmann
2012-07-06 21:01 ` Russell King - ARM Linux
2012-07-06 20:57 ` Russell King - ARM Linux
2012-07-06 22:49 ` Guennadi Liakhovetski
2012-07-13 6:51 ` Vinod Koul
2012-06-14 15:17 ` Guennadi Liakhovetski
2012-06-14 21:52 ` Jon Hunter
2012-06-15 8:41 ` Guennadi Liakhovetski
2012-06-15 9:00 ` Arnd Bergmann
2012-06-15 9:18 ` Guennadi Liakhovetski
2012-06-15 11:27 ` Arnd Bergmann
[not found] ` <201206151127.24386.arnd-r2nGTMty4D4@public.gmane.org>
2012-06-15 16:11 ` Mitch Bradley
[not found] ` <4FDB5ECF.3000701-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2012-06-16 6:56 ` Arnd Bergmann
2012-06-21 11:21 ` Guennadi Liakhovetski
2012-06-21 14:56 ` Arnd Bergmann
[not found] ` <201205161942.20296.arnd-r2nGTMty4D4@public.gmane.org>
2012-05-17 13:22 ` Russell King - ARM Linux
2012-05-17 13:52 ` Mark Brown
2012-05-17 14:16 ` Russell King - ARM Linux
2012-05-16 16:16 ` Jassi Brar
2012-05-16 17:12 ` Jon Hunter
2012-05-16 17:24 ` Jassi Brar
2012-05-16 17:37 ` Jon Hunter
2012-05-16 17:46 ` Stephen Warren
2012-05-16 18:03 ` Jon Hunter
2012-05-04 15:22 ` Jon Hunter
2012-05-04 15:56 ` Arnd Bergmann
2012-05-04 17:19 ` Jon Hunter
2012-05-04 19:06 ` Arnd Bergmann
2012-05-04 19:26 ` Jon Hunter
2012-05-04 18:30 ` Stephen Warren
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=4FAD6848.40700@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=arnd@arndb.de \
--cc=b-cousson@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=jaswinder.singh@linaro.org \
--cc=jon-hunter@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nicolas.ferre@atmel.com \
--cc=rob.herring@calxeda.com \
--cc=swarren@nvidia.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).