From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Guennadi Liakhovetski <g.liakhovetski-Mmb7MZpHnFY@public.gmane.org>
Cc: Vinod Koul <vinod.koul-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
device-tree
<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Jassi Brar
<jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Russell King - ARM Linux
<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
linux-omap <linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-arm
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH V3 1/2] of: Add generic device tree DMA helpers
Date: Fri, 6 Jul 2012 15:28:58 +0000 [thread overview]
Message-ID: <201207061528.58291.arnd@arndb.de> (raw)
In-Reply-To: <Pine.LNX.4.64.1207061315470.29809-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
On Friday 06 July 2012, Guennadi Liakhovetski wrote:
> On Mon, 25 Jun 2012, Arnd Bergmann wrote:
>
> [snip]
>
> > The channel data in the device tree is still in a format
> > that is specific to that dmaengine driver and interpreted
> > by it. Using the regular dma_filter_fn prototype is not
> > necessary, but it would be convenient because the dmaengine
> > code already knows how to deal with it. If we don't use this
> > method, how about adding another callback to struct dma_device
> > like
> >
> > bool (*device_match)(struct dma_chan *chan, struct property *req);
>
> I like this idea, but why don't we extend it to also cover the non-DT
> case? I.e., why don't we add the above callback (call it "match" or
> "filter" or anything else) to dmaengine operations and inside (the
> extended) dma_request_channel(), instead of calling the filter function,
> passed as a parameter, we loop over all registered DMAC devices and call
> their filter callbacks, until one of them returns true? In fact, it goes
> back to my earlier proposal from
> http://thread.gmane.org/gmane.linux.kernel/1246957
> which I, possibly, failed to explain properly. So, the transformation
> chain from today's API would be (all code is approximate):
>
> ...
> <dmaengine_core>
> for_each_channel() {
> ret = chan->device->device_alloc_chan_resources(chan, filter_arg);
> if (!ret)
> return chan;
> else if (ret != -ENODEV)
> return ret;
> /* -ENODEV - try the next channel */
> }
>
> Which is quite similar to my above mentioned proposal. Wouldn't this both
> improve the present API and prepare it for DT?
How would the individual driver know the size of the filter_arg? In the
device tree code, we would know if from #dma-cells of the engine node,
and that gets checked when reading the property, but when you have
a free-form data structure, it's much less clear.
Also, you could easily have an argument that looks valid for more than one
dmaengine, but really isn't.
I think for your proposal to work, we would need something like the
phandle for the dmaengine device that is at the start of the property
in the DT case.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 1/2] of: Add generic device tree DMA helpers
Date: Fri, 6 Jul 2012 15:28:58 +0000 [thread overview]
Message-ID: <201207061528.58291.arnd@arndb.de> (raw)
In-Reply-To: <Pine.LNX.4.64.1207061315470.29809@axis700.grange>
On Friday 06 July 2012, Guennadi Liakhovetski wrote:
> On Mon, 25 Jun 2012, Arnd Bergmann wrote:
>
> [snip]
>
> > The channel data in the device tree is still in a format
> > that is specific to that dmaengine driver and interpreted
> > by it. Using the regular dma_filter_fn prototype is not
> > necessary, but it would be convenient because the dmaengine
> > code already knows how to deal with it. If we don't use this
> > method, how about adding another callback to struct dma_device
> > like
> >
> > bool (*device_match)(struct dma_chan *chan, struct property *req);
>
> I like this idea, but why don't we extend it to also cover the non-DT
> case? I.e., why don't we add the above callback (call it "match" or
> "filter" or anything else) to dmaengine operations and inside (the
> extended) dma_request_channel(), instead of calling the filter function,
> passed as a parameter, we loop over all registered DMAC devices and call
> their filter callbacks, until one of them returns true? In fact, it goes
> back to my earlier proposal from
> http://thread.gmane.org/gmane.linux.kernel/1246957
> which I, possibly, failed to explain properly. So, the transformation
> chain from today's API would be (all code is approximate):
>
> ...
> <dmaengine_core>
> for_each_channel() {
> ret = chan->device->device_alloc_chan_resources(chan, filter_arg);
> if (!ret)
> return chan;
> else if (ret != -ENODEV)
> return ret;
> /* -ENODEV - try the next channel */
> }
>
> Which is quite similar to my above mentioned proposal. Wouldn't this both
> improve the present API and prepare it for DT?
How would the individual driver know the size of the filter_arg? In the
device tree code, we would know if from #dma-cells of the engine node,
and that gets checked when reading the property, but when you have
a free-form data structure, it's much less clear.
Also, you could easily have an argument that looks valid for more than one
dmaengine, but really isn't.
I think for your proposal to work, we would need something like the
phandle for the dmaengine device that is at the start of the property
in the DT case.
Arnd
next prev parent reply other threads:[~2012-07-06 15:28 UTC|newest]
Thread overview: 258+ 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-04-30 21:17 ` Jon Hunter
2012-05-03 22:26 ` Stephen Warren
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-03 23:25 ` Russell King - ARM Linux
2012-05-04 12:39 ` Arnd Bergmann
2012-05-04 12:39 ` Arnd Bergmann
2012-05-04 15:06 ` Jon Hunter
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 15:14 ` Russell King - ARM Linux
2012-05-04 18:21 ` Stephen Warren
2012-05-04 18:21 ` Stephen Warren
2012-05-04 19:19 ` Jon Hunter
2012-05-04 19:19 ` Jon Hunter
2012-05-04 6:56 ` Jassi Brar
2012-05-04 6:56 ` Jassi Brar
2012-05-04 15:17 ` Jon Hunter
2012-05-04 15:17 ` Jon Hunter
2012-05-04 19:01 ` Jassi Brar
2012-05-04 19:01 ` Jassi Brar
2012-05-04 19:23 ` Arnd Bergmann
2012-05-04 19:23 ` Arnd Bergmann
2012-05-05 17:10 ` Jassi Brar
2012-05-05 17:10 ` Jassi Brar
2012-05-07 15:53 ` Stephen Warren
2012-05-07 15:53 ` Stephen Warren
2012-05-07 17:19 ` Jassi Brar
2012-05-07 17:19 ` Jassi Brar
2012-05-08 16:35 ` Stephen Warren
2012-05-08 16:35 ` Stephen Warren
2012-05-08 19:09 ` Jassi Brar
2012-05-08 19:09 ` Jassi Brar
2012-05-09 12:30 ` Arnd Bergmann
2012-05-09 12:30 ` Arnd Bergmann
2012-05-09 19:10 ` Stephen Warren
2012-05-09 19:10 ` Stephen Warren
2012-05-09 21:38 ` Jassi Brar
2012-05-09 21:38 ` Jassi Brar
2012-05-10 17:00 ` Stephen Warren
2012-05-10 17:00 ` Stephen Warren
2012-05-10 19:59 ` Jassi Brar
2012-05-10 19:59 ` Jassi Brar
2012-05-11 19:28 ` Stephen Warren
2012-05-11 19:28 ` Stephen Warren
2012-05-11 21:06 ` Jassi Brar
2012-05-11 21:06 ` Jassi Brar
2012-05-11 23:51 ` Stephen Warren
2012-05-11 23:51 ` Stephen Warren
2012-05-12 13:40 ` Jassi Brar
2012-05-12 13:40 ` Jassi Brar
2012-05-16 1:05 ` Jon Hunter
2012-05-16 1:05 ` Jon Hunter
2012-05-17 13:18 ` Russell King - ARM Linux
2012-05-17 13:18 ` Russell King - ARM Linux
2012-05-07 17:21 ` Arnd Bergmann
2012-05-07 17:21 ` Arnd Bergmann
2012-05-16 1:11 ` Jon Hunter
2012-05-16 1:11 ` Jon Hunter
2012-05-16 12:37 ` Jassi Brar
2012-05-16 12:37 ` Jassi Brar
2012-05-16 13:15 ` Jon Hunter
2012-05-16 13:15 ` Jon Hunter
2012-05-16 15:44 ` Stephen Warren
2012-05-16 15:44 ` Stephen Warren
2012-05-16 16:04 ` Jon Hunter
2012-05-16 16:04 ` Jon Hunter
2012-05-16 16:01 ` Jon Hunter
2012-05-16 16:01 ` Jon Hunter
2012-05-16 16:15 ` Stephen Warren
2012-05-16 16:15 ` Stephen Warren
2012-05-16 16:22 ` Jassi Brar
2012-05-16 16:22 ` Jassi Brar
2012-05-16 17:09 ` Jon Hunter
2012-05-16 17:09 ` Jon Hunter
2012-05-16 19:42 ` Arnd Bergmann
2012-05-16 19:42 ` Arnd Bergmann
2012-05-16 21:16 ` Jassi Brar
2012-05-16 21:16 ` Jassi Brar
2012-05-17 19:32 ` Stephen Warren
2012-05-17 19:32 ` Stephen Warren
2012-05-18 17:12 ` Jassi Brar
2012-05-18 17:12 ` Jassi Brar
2012-05-18 21:04 ` Arnd Bergmann
2012-05-18 21:04 ` Arnd Bergmann
2012-05-16 23:59 ` Stephen Warren
2012-05-16 23:59 ` Stephen Warren
2012-05-17 4:05 ` Jassi Brar
2012-05-17 4:05 ` Jassi Brar
2012-05-18 20:49 ` Arnd Bergmann
2012-05-18 20:49 ` Arnd Bergmann
2012-05-18 21:07 ` Stephen Warren
2012-05-18 21:07 ` Stephen Warren
2012-05-18 21:43 ` Arnd Bergmann
2012-05-18 21:43 ` Arnd Bergmann
2012-05-18 22:20 ` Stephen Warren
2012-05-18 22:20 ` Stephen Warren
2012-05-19 8:44 ` Arnd Bergmann
2012-05-19 8:44 ` Arnd Bergmann
2012-05-21 17:33 ` Stephen Warren
2012-05-21 17:33 ` Stephen Warren
2012-05-21 18:18 ` Arnd Bergmann
2012-05-21 18:18 ` Arnd Bergmann
2012-05-21 20:32 ` Stephen Warren
2012-05-21 20:32 ` Stephen Warren
2012-06-08 19:04 ` Jon Hunter
2012-06-08 19:04 ` Jon Hunter
2012-06-09 0:04 ` Arnd Bergmann
2012-06-09 0:04 ` Arnd Bergmann
2012-06-13 22:32 ` Jon Hunter
2012-06-13 22:32 ` Jon Hunter
2012-06-14 4:45 ` Jassi Brar
2012-06-14 4:45 ` Jassi Brar
2012-06-14 11:48 ` Arnd Bergmann
2012-06-14 11:48 ` Arnd Bergmann
2012-06-14 15:39 ` Jon Hunter
2012-06-14 15:39 ` Jon Hunter
2012-06-15 8:40 ` Arnd Bergmann
2012-06-15 8:40 ` Arnd Bergmann
2012-06-22 22:52 ` Jon Hunter
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-22 23:12 ` Russell King - ARM Linux
2012-06-25 16:51 ` Jon Hunter
2012-06-25 16:51 ` Jon Hunter
2012-06-25 18:04 ` Vinod Koul
2012-06-25 18:04 ` Vinod Koul
2012-06-25 20:30 ` Arnd Bergmann
2012-06-25 20:30 ` Arnd Bergmann
2012-06-26 9:40 ` Vinod Koul
2012-06-26 9:40 ` Vinod Koul
2012-06-26 14:59 ` Arnd Bergmann
2012-06-26 14:59 ` Arnd Bergmann
2012-06-26 17:50 ` Vinod Koul
2012-06-26 17:50 ` Vinod Koul
2012-06-26 20:27 ` Arnd Bergmann
2012-06-26 20:27 ` Arnd Bergmann
2012-06-27 13:45 ` Vinod Koul
2012-06-27 13:45 ` Vinod Koul
2012-06-27 15:20 ` Arnd Bergmann
2012-06-27 15:20 ` Arnd Bergmann
2012-07-13 6:45 ` Vinod Koul
2012-07-13 6:45 ` Vinod Koul
2012-07-13 21:52 ` Guennadi Liakhovetski
2012-07-13 21:52 ` Guennadi Liakhovetski
2012-07-17 19:24 ` Arnd Bergmann
2012-07-17 19:24 ` Arnd Bergmann
2012-07-20 4:00 ` Vinod Koul
2012-07-20 4:00 ` Vinod Koul
2012-07-20 8:39 ` Arnd Bergmann
2012-07-20 8:39 ` Arnd Bergmann
2012-07-20 9:37 ` Vinod Koul
2012-07-20 9:37 ` Vinod Koul
2012-07-24 19:07 ` Jon Hunter
2012-07-24 19:07 ` Jon Hunter
2012-07-24 19:27 ` Arnd Bergmann
2012-07-24 19:27 ` Arnd Bergmann
2012-07-26 6:42 ` Vinod Koul
2012-07-26 6:42 ` Vinod Koul
2012-07-26 7:14 ` Arnd Bergmann
2012-07-26 7:14 ` Arnd Bergmann
2012-07-26 11:28 ` Vinod Koul
2012-07-26 11:28 ` Vinod Koul
2012-07-26 15:53 ` Jon Hunter
2012-07-26 15:53 ` Jon Hunter
[not found] ` <5011680A.6040400-l0cyMroinI0@public.gmane.org>
2012-07-31 11:06 ` Vinod Koul
2012-07-31 11:06 ` Vinod Koul
2012-07-26 17:43 ` Jon Hunter
2012-07-26 17:43 ` Jon Hunter
2012-07-31 11:12 ` Vinod Koul
2012-07-31 11:12 ` Vinod Koul
2012-08-01 20:43 ` Jon Hunter
2012-08-01 20:43 ` Jon Hunter
2012-08-03 9:55 ` Vinod Koul
2012-08-03 9:55 ` Vinod Koul
2012-07-20 9:08 ` Robert Jarzmik
2012-07-20 9:08 ` Robert Jarzmik
2012-07-20 9:41 ` Vinod Koul
2012-07-20 9:41 ` Vinod Koul
2012-07-26 4:56 ` zhangfei gao
2012-07-26 4:56 ` zhangfei gao
2012-07-23 21:29 ` Stephen Warren
2012-07-23 21:29 ` Stephen Warren
2012-07-24 7:19 ` Arnd Bergmann
2012-07-24 7:19 ` Arnd Bergmann
2012-07-24 16:04 ` Stephen Warren
2012-07-24 16:04 ` Stephen Warren
2012-07-24 18:55 ` Arnd Bergmann
2012-07-24 18:55 ` Arnd Bergmann
2012-07-24 12:54 ` Sergei Shtylyov
2012-07-24 12:54 ` Sergei Shtylyov
2012-07-06 11:36 ` Guennadi Liakhovetski
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 [this message]
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 15:43 ` Guennadi Liakhovetski
2012-07-06 17:31 ` Arnd Bergmann
2012-07-06 17:31 ` Arnd Bergmann
2012-07-06 21:01 ` Russell King - ARM Linux
2012-07-06 21:01 ` Russell King - ARM Linux
2012-07-06 20:57 ` Russell King - ARM Linux
2012-07-06 20:57 ` Russell King - ARM Linux
2012-07-06 22:49 ` Guennadi Liakhovetski
2012-07-06 22:49 ` Guennadi Liakhovetski
2012-07-13 6:51 ` Vinod Koul
2012-07-13 6:51 ` Vinod Koul
2012-06-14 15:17 ` Guennadi Liakhovetski
2012-06-14 15:17 ` Guennadi Liakhovetski
2012-06-14 21:52 ` Jon Hunter
2012-06-14 21:52 ` Jon Hunter
2012-06-15 8:41 ` Guennadi Liakhovetski
2012-06-15 8:41 ` Guennadi Liakhovetski
2012-06-15 9:00 ` Arnd Bergmann
2012-06-15 9:00 ` Arnd Bergmann
2012-06-15 9:18 ` Guennadi Liakhovetski
2012-06-15 9:18 ` Guennadi Liakhovetski
2012-06-15 11:27 ` Arnd Bergmann
2012-06-15 11:27 ` Arnd Bergmann
[not found] ` <201206151127.24386.arnd-r2nGTMty4D4@public.gmane.org>
2012-06-15 16:11 ` Mitch Bradley
2012-06-15 16:11 ` Mitch Bradley
[not found] ` <4FDB5ECF.3000701-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2012-06-16 6:56 ` Arnd Bergmann
2012-06-16 6:56 ` Arnd Bergmann
2012-06-21 11:21 ` Guennadi Liakhovetski
2012-06-21 11:21 ` Guennadi Liakhovetski
2012-06-21 14:56 ` Arnd Bergmann
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:22 ` Russell King - ARM Linux
2012-05-17 13:52 ` Mark Brown
2012-05-17 13:52 ` Mark Brown
2012-05-17 14:16 ` Russell King - ARM Linux
2012-05-17 14:16 ` Russell King - ARM Linux
2012-05-16 16:16 ` Jassi Brar
2012-05-16 16:16 ` Jassi Brar
2012-05-16 17:12 ` Jon Hunter
2012-05-16 17:12 ` Jon Hunter
2012-05-16 17:24 ` Jassi Brar
2012-05-16 17:24 ` Jassi Brar
2012-05-16 17:37 ` Jon Hunter
2012-05-16 17:37 ` Jon Hunter
2012-05-16 17:46 ` Stephen Warren
2012-05-16 17:46 ` Stephen Warren
2012-05-16 18:03 ` Jon Hunter
2012-05-16 18:03 ` Jon Hunter
2012-05-04 15:22 ` Jon Hunter
2012-05-04 15:22 ` Jon Hunter
2012-05-04 15:56 ` Arnd Bergmann
2012-05-04 15:56 ` Arnd Bergmann
2012-05-04 17:19 ` Jon Hunter
2012-05-04 17:19 ` Jon Hunter
2012-05-04 19:06 ` Arnd Bergmann
2012-05-04 19:06 ` Arnd Bergmann
2012-05-04 19:26 ` Jon Hunter
2012-05-04 19:26 ` Jon Hunter
2012-05-04 18:30 ` Stephen Warren
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=201207061528.58291.arnd@arndb.de \
--to=arnd-r2ngtmty4d4@public.gmane.org \
--cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=g.liakhovetski-Mmb7MZpHnFY@public.gmane.org \
--cc=jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=vinod.koul-VuQAYsv1563Yd54FQh9/CA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.