2013-03-05 21:13:01

by Matt Porter

[permalink] [raw]
Subject: [PATCH v2 0/3] omap_hsmmc DT DMA Client support

Changes since v1:
- rebase to 3.9-rc1, previous dependencies upstream

This series adds DT DMA Engine Client support to the omap_hsmmc.
It leverages the generic DMA OF helpers in -next and the
dma_request_slave_channel_compat() wrapper introduced in the
AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms
booting via DT. These platforms include omap2/3/4/5 and am33xx.

These patches were split out from the v5 version of the AM33XX DMA
series and split from the EDMA-specific omap_hsmmc changes.

Matt Porter (2):
mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()
mmc: omap_hsmmc: add generic DMA request support to the DT binding

Santosh Shilimkar (1):
mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case

.../devicetree/bindings/mmc/ti-omap-hsmmc.txt | 26 +++++++++++++-
drivers/mmc/host/omap_hsmmc.c | 38 ++++++++++++--------
2 files changed, 48 insertions(+), 16 deletions(-)

--
1.7.9.5


2013-03-05 21:13:05

by Matt Porter

[permalink] [raw]
Subject: [PATCH v2 1/3] mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()

Convert dmaengine channel requests to use
dma_request_slave_channel_compat(). This supports platforms booting
with or without DT populated.

Signed-off-by: Matt Porter <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
---
drivers/mmc/host/omap_hsmmc.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index bc58078..e79b12d 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1915,14 +1915,20 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);

- host->rx_chan = dma_request_channel(mask, omap_dma_filter_fn, &rx_req);
+ host->rx_chan =
+ dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
+ &rx_req, &pdev->dev, "rx");
+
if (!host->rx_chan) {
dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req);
ret = -ENXIO;
goto err_irq;
}

- host->tx_chan = dma_request_channel(mask, omap_dma_filter_fn, &tx_req);
+ host->tx_chan =
+ dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
+ &tx_req, &pdev->dev, "tx");
+
if (!host->tx_chan) {
dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req);
ret = -ENXIO;
--
1.7.9.5

2013-03-05 21:13:16

by Matt Porter

[permalink] [raw]
Subject: [PATCH v2 3/3] mmc: omap_hsmmc: add generic DMA request support to the DT binding

The binding definition is based on the generic DMA request binding.

Signed-off-by: Matt Porter <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
---
.../devicetree/bindings/mmc/ti-omap-hsmmc.txt | 26 +++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
index ed271fc..8c8908a 100644
--- a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
+++ b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
@@ -20,8 +20,29 @@ ti,dual-volt: boolean, supports dual voltage cards
ti,non-removable: non-removable slot (like eMMC)
ti,needs-special-reset: Requires a special softreset sequence
ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed
+dmas: List of DMA specifiers with the controller specific format
+as described in the generic DMA client binding. A tx and rx
+specifier is required.
+dma-names: List of DMA request names. These strings correspond
+1:1 with the DMA specifiers listed in dmas. The string naming is
+to be "rx" and "tx" for RX and TX DMA requests, respectively.
+
+Examples:
+
+[hwmod populated DMA resources]
+
+ mmc1: mmc@0x4809c000 {
+ compatible = "ti,omap4-hsmmc";
+ reg = <0x4809c000 0x400>;
+ ti,hwmods = "mmc1";
+ ti,dual-volt;
+ bus-width = <4>;
+ vmmc-supply = <&vmmc>; /* phandle to regulator node */
+ ti,non-removable;
+ };
+
+[generic DMA request binding]

-Example:
mmc1: mmc@0x4809c000 {
compatible = "ti,omap4-hsmmc";
reg = <0x4809c000 0x400>;
@@ -30,4 +51,7 @@ Example:
bus-width = <4>;
vmmc-supply = <&vmmc>; /* phandle to regulator node */
ti,non-removable;
+ dmas = <&edma 24
+ &edma 25>;
+ dma-names = "tx", "rx";
};
--
1.7.9.5

2013-03-05 21:13:43

by Matt Porter

[permalink] [raw]
Subject: [PATCH v2 2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case

From: Santosh Shilimkar <[email protected]>

MMC driver probe will abort for DT case because of failed
platform_get_resource_byname() lookup. Fix it by skipping resource
byname lookup for device tree build.

Issue is hidden because hwmod popullates the IO resources which
helps to succeed platform_get_resource_byname() and probe.

Signed-off-by: Santosh Shilimkar <[email protected]>
---
drivers/mmc/host/omap_hsmmc.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e79b12d..8ae1225 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1896,21 +1896,23 @@ static int omap_hsmmc_probe(struct platform_device *pdev)

omap_hsmmc_conf_bus_power(host);

- res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
- if (!res) {
- dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
- ret = -ENXIO;
- goto err_irq;
- }
- tx_req = res->start;
+ if (!pdev->dev.of_node) {
+ res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
+ if (!res) {
+ dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
+ ret = -ENXIO;
+ goto err_irq;
+ }
+ tx_req = res->start;

- res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
- if (!res) {
- dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
- ret = -ENXIO;
- goto err_irq;
+ res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
+ if (!res) {
+ dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
+ ret = -ENXIO;
+ goto err_irq;
+ }
+ rx_req = res->start;
}
- rx_req = res->start;

dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
--
1.7.9.5

2013-03-05 21:26:17

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] omap_hsmmc DT DMA Client support

On Tuesday 05 March 2013, Matt Porter wrote:
> Changes since v1:
> - rebase to 3.9-rc1, previous dependencies upstream
>
> This series adds DT DMA Engine Client support to the omap_hsmmc.
> It leverages the generic DMA OF helpers in -next and the
> dma_request_slave_channel_compat() wrapper introduced in the
> AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms
> booting via DT. These platforms include omap2/3/4/5 and am33xx.
>
> These patches were split out from the v5 version of the AM33XX DMA
> series and split from the EDMA-specific omap_hsmmc changes.
>

The description seems stale, but the patches all look good to me.

I guess they can now get merged in any order.

Acked-by: Arnd Bergmann <[email protected]>

2013-03-06 13:36:54

by Matt Porter

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] omap_hsmmc DT DMA Client support

On Tue, Mar 05, 2013 at 09:26:01PM +0000, Arnd Bergmann wrote:
> On Tuesday 05 March 2013, Matt Porter wrote:
> > Changes since v1:
> > - rebase to 3.9-rc1, previous dependencies upstream
> >
> > This series adds DT DMA Engine Client support to the omap_hsmmc.
> > It leverages the generic DMA OF helpers in -next and the
> > dma_request_slave_channel_compat() wrapper introduced in the
> > AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms
> > booting via DT. These platforms include omap2/3/4/5 and am33xx.
> >
> > These patches were split out from the v5 version of the AM33XX DMA
> > series and split from the EDMA-specific omap_hsmmc changes.
> >
>
> The description seems stale, but the patches all look good to me.
>
> I guess they can now get merged in any order.
>
> Acked-by: Arnd Bergmann <[email protected]>

Yes, missed updating that to indicating that those are now in
3.9-rc1.

-Matt

2013-03-06 13:42:57

by Balaji T K

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case

On Wednesday 06 March 2013 02:43 AM, Matt Porter wrote:
> From: Santosh Shilimkar <[email protected]>
>
> MMC driver probe will abort for DT case because of failed
> platform_get_resource_byname() lookup. Fix it by skipping resource
> byname lookup for device tree build.
>
> Issue is hidden because hwmod popullates the IO resources which
> helps to succeed platform_get_resource_byname() and probe.
>

Hi Matt,
Could you please drop this patch from the current series,
since this patch causes regression on omap3,4 platform
which are not yet dma dt adapted.
It is best to send this patch along with Jon Hunter dma dt series,
which adds dt dma support and mmc dma data. DMA dt series is needed
any way before hwmod cleanup can happen.


> Signed-off-by: Santosh Shilimkar <[email protected]>
> ---
> drivers/mmc/host/omap_hsmmc.c | 28 +++++++++++++++-------------
> 1 file changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index e79b12d..8ae1225 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1896,21 +1896,23 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>
> omap_hsmmc_conf_bus_power(host);
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
> - if (!res) {
> - dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
> - ret = -ENXIO;
> - goto err_irq;
> - }
> - tx_req = res->start;
> + if (!pdev->dev.of_node) {
> + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
> + if (!res) {
> + dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
> + ret = -ENXIO;
> + goto err_irq;
> + }
> + tx_req = res->start;
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
> - if (!res) {
> - dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
> - ret = -ENXIO;
> - goto err_irq;
> + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
> + if (!res) {
> + dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
> + ret = -ENXIO;
> + goto err_irq;
> + }
> + rx_req = res->start;
> }
> - rx_req = res->start;
>
> dma_cap_zero(mask);
> dma_cap_set(DMA_SLAVE, mask);
>

2013-03-06 13:55:39

by Matt Porter

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case

On Wed, Mar 06, 2013 at 07:12:29PM +0530, Balaji T K wrote:
> On Wednesday 06 March 2013 02:43 AM, Matt Porter wrote:
> >From: Santosh Shilimkar <[email protected]>
> >
> >MMC driver probe will abort for DT case because of failed
> >platform_get_resource_byname() lookup. Fix it by skipping resource
> >byname lookup for device tree build.
> >
> >Issue is hidden because hwmod popullates the IO resources which
> >helps to succeed platform_get_resource_byname() and probe.
> >
>
> Hi Matt,
> Could you please drop this patch from the current series,
> since this patch causes regression on omap3,4 platform
> which are not yet dma dt adapted.
> It is best to send this patch along with Jon Hunter dma dt series,
> which adds dt dma support and mmc dma data. DMA dt series is needed
> any way before hwmod cleanup can happen.

*sigh* ok, I should have never split this stuff out from the am33xx
series. Will do.

-Matt

> >Signed-off-by: Santosh Shilimkar <[email protected]>
> >---
> > drivers/mmc/host/omap_hsmmc.c | 28 +++++++++++++++-------------
> > 1 file changed, 15 insertions(+), 13 deletions(-)
> >
> >diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> >index e79b12d..8ae1225 100644
> >--- a/drivers/mmc/host/omap_hsmmc.c
> >+++ b/drivers/mmc/host/omap_hsmmc.c
> >@@ -1896,21 +1896,23 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
> >
> > omap_hsmmc_conf_bus_power(host);
> >
> >- res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
> >- if (!res) {
> >- dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
> >- ret = -ENXIO;
> >- goto err_irq;
> >- }
> >- tx_req = res->start;
> >+ if (!pdev->dev.of_node) {
> >+ res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
> >+ if (!res) {
> >+ dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
> >+ ret = -ENXIO;
> >+ goto err_irq;
> >+ }
> >+ tx_req = res->start;
> >
> >- res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
> >- if (!res) {
> >- dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
> >- ret = -ENXIO;
> >- goto err_irq;
> >+ res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
> >+ if (!res) {
> >+ dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
> >+ ret = -ENXIO;
> >+ goto err_irq;
> >+ }
> >+ rx_req = res->start;
> > }
> >- rx_req = res->start;
> >
> > dma_cap_zero(mask);
> > dma_cap_set(DMA_SLAVE, mask);
> >
>
> _______________________________________________
> devicetree-discuss mailing list
> [email protected]
> https://lists.ozlabs.org/listinfo/devicetree-discuss

2013-03-06 16:41:07

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case


On 03/06/2013 07:56 AM, Matt Porter wrote:
> On Wed, Mar 06, 2013 at 07:12:29PM +0530, Balaji T K wrote:
>> On Wednesday 06 March 2013 02:43 AM, Matt Porter wrote:
>>> From: Santosh Shilimkar <[email protected]>
>>>
>>> MMC driver probe will abort for DT case because of failed
>>> platform_get_resource_byname() lookup. Fix it by skipping resource
>>> byname lookup for device tree build.
>>>
>>> Issue is hidden because hwmod popullates the IO resources which
>>> helps to succeed platform_get_resource_byname() and probe.
>>>
>>
>> Hi Matt,
>> Could you please drop this patch from the current series,
>> since this patch causes regression on omap3,4 platform
>> which are not yet dma dt adapted.
>> It is best to send this patch along with Jon Hunter dma dt series,
>> which adds dt dma support and mmc dma data. DMA dt series is needed
>> any way before hwmod cleanup can happen.
>
> *sigh* ok, I should have never split this stuff out from the am33xx
> series. Will do.

There will not be any regression if all of these make the same merge
window. I am hoping that the omap dma patches will make 3.10 as well. I
think that it is best for Matt to keep his patches together although now
I see he has already posted a V3 dropping this :-(

Jon

2013-06-14 18:10:16

by Joel A Fernandes

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] omap_hsmmc DT DMA Client support

Hi,

On Wed, Mar 6, 2013 at 7:37 AM, Matt Porter <[email protected]> wrote:
> On Tue, Mar 05, 2013 at 09:26:01PM +0000, Arnd Bergmann wrote:
>> On Tuesday 05 March 2013, Matt Porter wrote:
>> > Changes since v1:
>> > - rebase to 3.9-rc1, previous dependencies upstream
>> >
>> > This series adds DT DMA Engine Client support to the omap_hsmmc.
>> > It leverages the generic DMA OF helpers in -next and the
>> > dma_request_slave_channel_compat() wrapper introduced in the
>> > AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms
>> > booting via DT. These platforms include omap2/3/4/5 and am33xx.
>> >
>> > These patches were split out from the v5 version of the AM33XX DMA
>> > series and split from the EDMA-specific omap_hsmmc changes.
>> >
>>
>> The description seems stale, but the patches all look good to me.
>>
>> I guess they can now get merged in any order.
>>
>> Acked-by: Arnd Bergmann <[email protected]>
>
> Yes, missed updating that to indicating that those are now in
> 3.9-rc1.

If there are no more changes, could this patch please be merged in for
3.10 or if not, could Matt please update the description as requested
and repost?

Thanks,
Joel

2013-06-14 18:11:00

by Joel A Fernandes

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] omap_hsmmc DT DMA Client support

Resending on Matt's new email, thanks.

On Fri, Jun 14, 2013 at 1:10 PM, Joel A Fernandes <[email protected]> wrote:
> Hi,
>
> On Wed, Mar 6, 2013 at 7:37 AM, Matt Porter <[email protected]> wrote:
>> On Tue, Mar 05, 2013 at 09:26:01PM +0000, Arnd Bergmann wrote:
>>> On Tuesday 05 March 2013, Matt Porter wrote:
>>> > Changes since v1:
>>> > - rebase to 3.9-rc1, previous dependencies upstream
>>> >
>>> > This series adds DT DMA Engine Client support to the omap_hsmmc.
>>> > It leverages the generic DMA OF helpers in -next and the
>>> > dma_request_slave_channel_compat() wrapper introduced in the
>>> > AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms
>>> > booting via DT. These platforms include omap2/3/4/5 and am33xx.
>>> >
>>> > These patches were split out from the v5 version of the AM33XX DMA
>>> > series and split from the EDMA-specific omap_hsmmc changes.
>>> >
>>>
>>> The description seems stale, but the patches all look good to me.
>>>
>>> I guess they can now get merged in any order.
>>>
>>> Acked-by: Arnd Bergmann <[email protected]>
>>
>> Yes, missed updating that to indicating that those are now in
>> 3.9-rc1.
>
> If there are no more changes, could this patch please be merged in for
> 3.10 or if not, could Matt please update the description as requested
> and repost?
>
> Thanks,
> Joel

2013-06-17 15:45:07

by Balaji T K

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] omap_hsmmc DT DMA Client support

On Friday 14 June 2013 11:40 PM, Joel A Fernandes wrote:
> Resending on Matt's new email, thanks.
>
> On Fri, Jun 14, 2013 at 1:10 PM, Joel A Fernandes <[email protected]> wrote:
>> Hi,
>>
>> On Wed, Mar 6, 2013 at 7:37 AM, Matt Porter <[email protected]> wrote:
>>> On Tue, Mar 05, 2013 at 09:26:01PM +0000, Arnd Bergmann wrote:
>>>> On Tuesday 05 March 2013, Matt Porter wrote:
>>>>> Changes since v1:
>>>>> - rebase to 3.9-rc1, previous dependencies upstream
>>>>>
>>>>> This series adds DT DMA Engine Client support to the omap_hsmmc.
>>>>> It leverages the generic DMA OF helpers in -next and the
>>>>> dma_request_slave_channel_compat() wrapper introduced in the
>>>>> AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms
>>>>> booting via DT. These platforms include omap2/3/4/5 and am33xx.
>>>>>
>>>>> These patches were split out from the v5 version of the AM33XX DMA
>>>>> series and split from the EDMA-specific omap_hsmmc changes.
>>>>>
>>>>
>>>> The description seems stale, but the patches all look good to me.
>>>>
>>>> I guess they can now get merged in any order.
>>>>
>>>> Acked-by: Arnd Bergmann <[email protected]>
>>>
>>> Yes, missed updating that to indicating that those are now in
>>> 3.9-rc1.
>>
>> If there are no more changes, could this patch please be merged in for
>> 3.10 or if not, could Matt please update the description as requested
>> and repost?
>>
Hi Joel,

mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case
mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()
got merged in 3.10 rc5

mmc: omap_hsmmc: add generic DMA request support to the DT binding
should go along with edma dts patch series

>> Thanks,
>> Joel