diff mbox

[v2,2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case

Message ID 1362518004-7083-3-git-send-email-mporter@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Matt Porter March 5, 2013, 9:13 p.m. UTC
From: Santosh Shilimkar <santosh.shilimkar@ti.com>

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 <santosh.shilimkar@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |   28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

Comments

Balaji T K March 6, 2013, 1:42 p.m. UTC | #1
On Wednesday 06 March 2013 02:43 AM, Matt Porter wrote:
> From: Santosh Shilimkar <santosh.shilimkar@ti.com>
>
> 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 <santosh.shilimkar@ti.com>
> ---
>   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);
>

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Matt Porter March 6, 2013, 1:56 p.m. UTC | #2
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 <santosh.shilimkar@ti.com>
> >
> >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 <santosh.shilimkar@ti.com>
> >---
> >  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
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hunter, Jon March 6, 2013, 4:40 p.m. UTC | #3
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 <santosh.shilimkar@ti.com>
>>>
>>> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);