From: "Cousson, Benoit" <b-cousson-l0cyMroinI0@public.gmane.org>
To: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
linux-omap <linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [RFC PATCH 1/2] of: Add generic device tree DMA helpers
Date: Thu, 2 Feb 2012 09:54:08 +0100 [thread overview]
Message-ID: <4F2A4F30.1030706@ti.com> (raw)
In-Reply-To: <20120202084539.GC1275-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
On 2/2/2012 9:45 AM, Russell King - ARM Linux wrote:
> On Wed, Feb 01, 2012 at 11:50:30AM +0100, Cousson, Benoit wrote:
>> Hi Russell,
>>
>> On 2/1/2012 12:09 AM, Russell King - ARM Linux wrote:
>>> On Sat, Jan 28, 2012 at 11:06:02AM -0700, Grant Likely wrote:
>>>> This makes the assumption that dma specifiers will only ever be 1
>>>> cell. I think to be generally useful, the full dma specifier needs to
>>>> be either handed to the dma controller to get a cookie or passed back
>>>> to the caller in its entirety.
>>>
>>> More to the point, who says that the DMA specifier is even an integer?
>>> When people are using DMA engines, it (probably) isn't an integer at
>>> all. Several platforms I know of use strings for this.
>>>
>>> Some platforms can even select between two or more DMA engines for
>>> handling the same peripheral - I believe Samsung do this depending
>>> on their individual workloads.
>>>
>>> However, the opaque DMA engine API for requesting a channel doesn't
>>> lend itself well to DT, as the match data and match function are
>>> entirely left to the individual DMA engine driver and/or platform
>>> itself.
>>>
>>> As far as creating another linear number space for DMA stuff, I'd
>>> really suggest against that - you're going to need some additional
>>> code in place to manage that numberspace. If you at least use a two-
>>> paid cookie, eg 'dma controller phandle + request signal' then that
>>> makes all the stuff we're starting to see with the IRQ subsystem,
>>> IRQ domains etc become completely unnecessary.
>>>
>>> I guess what I'm saying is ignore the flat number space, and go
>>> straight to some kind of 'dma domains' solution from the start.
>>
>> Fully agree, and this is exactly the idea of this DMA binding: First
>> argument is always a DMA controller phandle and then you can add 0, 1 or
>> more cells to define extra specifiers dependent of the DMA controller
>> driver expectation. The one cell Grant was referring was just the extra
>> specifier that is needed for a simple DMA engine like the SDMA we have
>> inside OMAP. But the whole idea is to have a flexible enough mechanism
>> to allow any kind of specifier.
>>
>> No more global linear number space like for IRQ!
>
> How does this work when you're stuffing a number into a struct resource
> as a plain DMA number? That looks very much like a linear number space,
> as you don't have a way to associate that number with anything else.
As explained in the kernel doc header and in the changelog, that one is for legacy purpose only.
+/**
+ * of_dma_to_resource - Decode a node's DMA and return it as a resource
+ * @dev: pointer to device tree node
+ * @index: zero-based index of the DMA request
+ * @r: pointer to resource structure to return result into.
+ *
+ * Using a resource to export a DMA request number to a driver should
+ * be used only for legacy purpose and on system when only one DMA controller
+ * is present.
+ * The proper and only scalable way is to use the native of_get_dma_request API
+ * in order retrieve both the DMA controller device node and the DMA request
+ * line for that controller.
+ */
There is indeed no way to put information about DMA controller and DMA line in the resource structure except if we start hacking the start and end attributes. But I'm not sure anyone will want to do that.
The only way to take benefit of the extra information DT can provide is to use the of_get_dma_request API.
Regards,
Benoit
WARNING: multiple messages have this Message-ID (diff)
From: b-cousson@ti.com (Cousson, Benoit)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/2] of: Add generic device tree DMA helpers
Date: Thu, 2 Feb 2012 09:54:08 +0100 [thread overview]
Message-ID: <4F2A4F30.1030706@ti.com> (raw)
In-Reply-To: <20120202084539.GC1275@n2100.arm.linux.org.uk>
On 2/2/2012 9:45 AM, Russell King - ARM Linux wrote:
> On Wed, Feb 01, 2012 at 11:50:30AM +0100, Cousson, Benoit wrote:
>> Hi Russell,
>>
>> On 2/1/2012 12:09 AM, Russell King - ARM Linux wrote:
>>> On Sat, Jan 28, 2012 at 11:06:02AM -0700, Grant Likely wrote:
>>>> This makes the assumption that dma specifiers will only ever be 1
>>>> cell. I think to be generally useful, the full dma specifier needs to
>>>> be either handed to the dma controller to get a cookie or passed back
>>>> to the caller in its entirety.
>>>
>>> More to the point, who says that the DMA specifier is even an integer?
>>> When people are using DMA engines, it (probably) isn't an integer at
>>> all. Several platforms I know of use strings for this.
>>>
>>> Some platforms can even select between two or more DMA engines for
>>> handling the same peripheral - I believe Samsung do this depending
>>> on their individual workloads.
>>>
>>> However, the opaque DMA engine API for requesting a channel doesn't
>>> lend itself well to DT, as the match data and match function are
>>> entirely left to the individual DMA engine driver and/or platform
>>> itself.
>>>
>>> As far as creating another linear number space for DMA stuff, I'd
>>> really suggest against that - you're going to need some additional
>>> code in place to manage that numberspace. If you at least use a two-
>>> paid cookie, eg 'dma controller phandle + request signal' then that
>>> makes all the stuff we're starting to see with the IRQ subsystem,
>>> IRQ domains etc become completely unnecessary.
>>>
>>> I guess what I'm saying is ignore the flat number space, and go
>>> straight to some kind of 'dma domains' solution from the start.
>>
>> Fully agree, and this is exactly the idea of this DMA binding: First
>> argument is always a DMA controller phandle and then you can add 0, 1 or
>> more cells to define extra specifiers dependent of the DMA controller
>> driver expectation. The one cell Grant was referring was just the extra
>> specifier that is needed for a simple DMA engine like the SDMA we have
>> inside OMAP. But the whole idea is to have a flexible enough mechanism
>> to allow any kind of specifier.
>>
>> No more global linear number space like for IRQ!
>
> How does this work when you're stuffing a number into a struct resource
> as a plain DMA number? That looks very much like a linear number space,
> as you don't have a way to associate that number with anything else.
As explained in the kernel doc header and in the changelog, that one is for legacy purpose only.
+/**
+ * of_dma_to_resource - Decode a node's DMA and return it as a resource
+ * @dev: pointer to device tree node
+ * @index: zero-based index of the DMA request
+ * @r: pointer to resource structure to return result into.
+ *
+ * Using a resource to export a DMA request number to a driver should
+ * be used only for legacy purpose and on system when only one DMA controller
+ * is present.
+ * The proper and only scalable way is to use the native of_get_dma_request API
+ * in order retrieve both the DMA controller device node and the DMA request
+ * line for that controller.
+ */
There is indeed no way to put information about DMA controller and DMA line in the resource structure except if we start hacking the start and end attributes. But I'm not sure anyone will want to do that.
The only way to take benefit of the extra information DT can provide is to use the of_get_dma_request API.
Regards,
Benoit
next prev parent reply other threads:[~2012-02-02 8:54 UTC|newest]
Thread overview: 160+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-27 17:29 [RFC PATCH 1/2] of: Add generic device tree DMA helpers Cousson, Benoit
2012-01-27 17:29 ` Cousson, Benoit
2012-01-27 18:13 ` Stephen Warren
2012-01-27 18:13 ` Stephen Warren
2012-01-27 20:36 ` Cousson, Benoit
2012-01-27 20:36 ` Cousson, Benoit
2012-01-28 18:12 ` Grant Likely
2012-01-28 18:12 ` Grant Likely
2012-01-28 18:06 ` Grant Likely
2012-01-28 18:06 ` Grant Likely
2012-01-31 21:26 ` Cousson, Benoit
2012-01-31 21:26 ` Cousson, Benoit
2012-02-02 4:52 ` Grant Likely
2012-02-02 4:52 ` Grant Likely
2012-01-31 23:09 ` Russell King - ARM Linux
2012-01-31 23:09 ` Russell King - ARM Linux
2012-02-01 10:50 ` Cousson, Benoit
2012-02-01 10:50 ` Cousson, Benoit
[not found] ` <4F2918F6.9040100-l0cyMroinI0@public.gmane.org>
2012-02-02 8:45 ` Russell King - ARM Linux
2012-02-02 8:45 ` Russell King - ARM Linux
[not found] ` <20120202084539.GC1275-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-02-02 8:54 ` Cousson, Benoit [this message]
2012-02-02 8:54 ` Cousson, Benoit
2012-02-22 10:59 ` Nicolas Ferre
2012-02-22 10:59 ` Nicolas Ferre
2012-02-23 10:03 ` Cousson, Benoit
2012-02-23 10:03 ` Cousson, Benoit
2012-02-23 15:51 ` Nicolas Ferre
2012-02-23 15:51 ` Nicolas Ferre
2012-02-23 15:57 ` Cousson, Benoit
2012-02-23 15:57 ` Cousson, Benoit
[not found] ` <4F4661DE.90704-l0cyMroinI0@public.gmane.org>
2012-02-27 13:09 ` Nicolas Ferre
2012-02-27 13:09 ` Nicolas Ferre
2012-02-27 14:22 ` Cousson, Benoit
2012-02-27 14:22 ` Cousson, Benoit
2012-02-27 17:28 ` Nicolas Ferre
2012-02-27 17:28 ` Nicolas Ferre
2012-02-29 14:54 ` [RFC PATCH] of: DMA helpers: manage generic requests specification Nicolas Ferre
2012-02-29 14:54 ` Nicolas Ferre
2012-02-29 20:54 ` Stephen Warren
2012-02-29 20:54 ` Stephen Warren
2012-03-05 13:14 ` Cousson, Benoit
2012-03-05 13:14 ` Cousson, Benoit
2012-03-05 18:30 ` Stephen Warren
2012-03-05 18:30 ` Stephen Warren
2012-03-05 19:57 ` Russell King - ARM Linux
2012-03-05 19:57 ` Russell King - ARM Linux
2012-03-05 10:55 ` Cousson, Benoit
2012-03-05 10:55 ` Cousson, Benoit
2012-03-05 15:36 ` Grant Likely
2012-03-05 15:36 ` Grant Likely
2012-03-14 17:47 ` Nicolas Ferre
2012-03-14 17:47 ` Nicolas Ferre
2012-03-14 18:16 ` Stephen Warren
2012-03-14 18:16 ` Stephen Warren
[not found] ` <4F22DEF2.5000807-l0cyMroinI0@public.gmane.org>
2012-03-15 8:38 ` [PATCH] of: Add generic device tree DMA helpers Nicolas Ferre
2012-03-15 8:38 ` Nicolas Ferre
2012-03-15 9:22 ` Arnd Bergmann
2012-03-15 9:22 ` Arnd Bergmann
2012-03-15 9:26 ` Russell King - ARM Linux
2012-03-15 9:26 ` Russell King - ARM Linux
2012-03-15 10:09 ` Arnd Bergmann
2012-03-15 10:09 ` Arnd Bergmann
2012-03-17 9:42 ` Grant Likely
2012-03-17 9:42 ` Grant Likely
2012-03-17 16:03 ` Arnd Bergmann
2012-03-17 16:03 ` Arnd Bergmann
2012-03-18 9:08 ` Grant Likely
2012-03-18 9:08 ` Grant Likely
2012-03-15 10:27 ` Thierry Reding
2012-03-15 10:27 ` Thierry Reding
2012-03-17 10:47 ` Grant Likely
2012-03-17 10:47 ` Grant Likely
2012-03-18 9:22 ` Thierry Reding
2012-03-18 9:22 ` Thierry Reding
2012-03-18 15:10 ` Arnd Bergmann
2012-03-18 15:10 ` Arnd Bergmann
2012-03-18 18:22 ` Grant Likely
2012-03-18 18:22 ` Grant Likely
2012-03-19 13:02 ` Mark Brown
2012-03-19 13:02 ` Mark Brown
2012-03-19 15:01 ` Arnd Bergmann
2012-03-19 15:01 ` Arnd Bergmann
2012-03-19 15:07 ` Stephen Warren
2012-03-19 15:07 ` Stephen Warren
2012-03-19 15:45 ` Arnd Bergmann
2012-03-19 15:45 ` Arnd Bergmann
[not found] ` <201203191545.40933.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-19 16:54 ` Stephen Warren
2012-03-19 16:54 ` Stephen Warren
2012-03-15 16:30 ` Cousson, Benoit
2012-03-15 16:30 ` Cousson, Benoit
2012-03-15 19:57 ` Russell King - ARM Linux
2012-03-15 19:57 ` Russell King - ARM Linux
[not found] ` <20120315195753.GA2842-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-03-15 20:41 ` Arnd Bergmann
2012-03-15 20:41 ` Arnd Bergmann
2012-03-15 21:39 ` Cousson, Benoit
2012-03-15 21:39 ` Cousson, Benoit
2012-03-15 21:55 ` Russell King - ARM Linux
2012-03-15 21:55 ` Russell King - ARM Linux
2012-03-16 9:56 ` Arnd Bergmann
2012-03-16 9:56 ` Arnd Bergmann
2012-03-20 14:02 ` Matt Porter
2012-03-20 14:02 ` Matt Porter
2012-03-15 23:45 ` Nicolas Pitre
2012-03-15 23:45 ` Nicolas Pitre
2012-03-16 10:03 ` Arnd Bergmann
2012-03-16 10:03 ` Arnd Bergmann
2012-03-16 11:19 ` Cousson, Benoit
2012-03-16 11:19 ` Cousson, Benoit
2012-03-16 12:04 ` Arnd Bergmann
2012-03-16 12:04 ` Arnd Bergmann
2012-03-16 13:28 ` Cousson, Benoit
2012-03-16 13:28 ` Cousson, Benoit
2012-03-16 13:36 ` Nicolas Ferre
2012-03-16 13:36 ` Nicolas Ferre
2012-03-17 9:40 ` Grant Likely
2012-03-17 9:40 ` Grant Likely
2012-03-18 20:13 ` Arnd Bergmann
2012-03-18 20:13 ` Arnd Bergmann
2012-03-18 20:44 ` Grant Likely
2012-03-18 20:44 ` Grant Likely
2012-03-18 21:58 ` Arnd Bergmann
2012-03-18 21:58 ` Arnd Bergmann
2012-03-18 22:12 ` Arnd Bergmann
2012-03-18 22:12 ` Arnd Bergmann
2012-03-19 13:37 ` Nicolas Ferre
2012-03-19 13:37 ` Nicolas Ferre
2012-03-19 15:20 ` Russell King - ARM Linux
2012-03-19 15:20 ` Russell King - ARM Linux
2012-03-19 15:58 ` Cousson, Benoit
2012-03-19 15:58 ` Cousson, Benoit
2012-03-19 13:30 ` Nicolas Ferre
2012-03-19 13:30 ` Nicolas Ferre
2012-03-19 14:06 ` Arnd Bergmann
2012-03-19 14:06 ` Arnd Bergmann
2012-03-19 15:33 ` Russell King - ARM Linux
2012-03-19 15:33 ` Russell King - ARM Linux
2012-03-19 16:11 ` Arnd Bergmann
2012-03-19 16:11 ` Arnd Bergmann
2012-03-19 18:06 ` Jassi Brar
2012-03-19 18:06 ` Jassi Brar
2012-03-19 16:31 ` Nicolas Ferre
2012-03-19 16:31 ` Nicolas Ferre
2012-03-19 17:49 ` Cousson, Benoit
2012-03-19 17:49 ` Cousson, Benoit
2012-03-19 14:45 ` Grant Likely
2012-03-19 14:45 ` Grant Likely
2012-03-20 14:54 ` Nicolas Ferre
2012-03-20 14:54 ` Nicolas Ferre
2012-03-20 10:13 ` [PATCH v2 1/2] " Nicolas Ferre
2012-03-20 10:13 ` Nicolas Ferre
2012-03-20 10:13 ` [PATCH 2/2] of: selftest/dma: Add selftest for new DT DMA request helpers Nicolas Ferre
2012-03-20 10:13 ` Nicolas Ferre
2012-03-20 14:16 ` Grant Likely
2012-03-20 14:16 ` Grant Likely
2012-03-20 10:17 ` [PATCH] of: dma/fixup Nicolas Ferre
2012-03-20 10:17 ` Nicolas Ferre
[not found] ` <6b5dc1fadfd03a48093338b6981c0a7ae7662212.1332237596.git.nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2012-03-20 13:03 ` [PATCH v2 1/2] of: Add generic device tree DMA helpers Arnd Bergmann
2012-03-20 13:03 ` Arnd Bergmann
2012-03-20 15:38 ` Stephen Warren
2012-03-20 15:38 ` 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=4F2A4F30.1030706@ti.com \
--to=b-cousson-l0cymroini0@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@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 \
/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.