Skip to contentSkip to conversation

mmc: davinci: allow driver to work without DMA resource

PATCH Superseded Manjunathappa, Prakash 2 participants 3 messages Jan 31, 2013 – Feb 4, 2013 MMC, SD and SDIO

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: davinci: allow driver to work without DMA resource

Do not return probe failure with missing DMA resources, allow driver to work in PIO mode.
Tested on da850-evm.

---
 drivers/mmc/host/davinci_mmc.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/host/davinci_mmc.c +6 -4
index 2063677..382b79d 100644
@@ -1190,13 +1190,15 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
 
 	r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
 	if (!r)
-		goto out;
-	host->rxdma = r->start;
+		dev_warn(&pdev->dev, "DMA resource not specified\n");
+	else
+		host->rxdma = r->start;
 
 	r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
 	if (!r)
-		goto out;
-	host->txdma = r->start;
+		dev_warn(&pdev->dev, "DMA resource not specified\n");
+	else
+		host->txdma = r->start;
 
 	host->mem_res = mem;
 	host->base = ioremap(mem->start, mem_size);
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 3 lines · Prakash

Do not return probe failure with missing DMA resources, allow driver to work in PIO mode.
Tested on da850-evm.

It will be nice to mention what exactly was tested. rootfs mount? file create/deletion? mount/unmount?

Quoted 10 lines
---
 drivers/mmc/host/davinci_mmc.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/host/davinci_mmc.c +0 -0
index 2063677..382b79d 100644

drivers/mmc/host/davinci_mmc.c static int __init davinci_mmcsd_probe(struct platform_device *pdev) · line 1193

Quoted 6 lines
drivers/mmc/host/davinci_mmc.c +1 -2
@@ -1190,13 +1190,15 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
 
 	r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
 	if (!r)
-		goto out;
-	host->rxdma = r->start;
+		dev_warn(&pdev->dev, "DMA resource not specified\n");

Why not be specific and call it "RX DMA" instead. Anyone who gets this error will have to do that anyway since you have now got two identical error messages.

drivers/mmc/host/davinci_mmc.c static int __init davinci_mmcsd_probe(struct platform_device *pdev) · line 1199

Quoted 8 lines
drivers/mmc/host/davinci_mmc.c +3 -2
+	else
+		host->rxdma = r->start;
 
 	r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
 	if (!r)
-		goto out;
-	host->txdma = r->start;
+		dev_warn(&pdev->dev, "DMA resource not specified\n");

"TX DMA" here.

Thanks,
Sekhar

#2 lore raw

Hi Sekhar,

Quoted 8 lines · Sekhar
Quoted 3 lines · Prakash

Do not return probe failure with missing DMA resources, allow driver to work in PIO mode.
Tested on da850-evm.

It will be nice to mention what exactly was tested. rootfs mount? file create/deletion? mount/unmount?

Agreed, will add testing information.

Quoted 11 lines
Quoted 11 lines
---
 drivers/mmc/host/davinci_mmc.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/host/davinci_mmc.c +0 -0
index 2063677..382b79d 100644
@@ -1190,13 +1190,15 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
 
Quoted 10 lines

drivers/mmc/host/davinci_mmc.c static int __init davinci_mmcsd_probe(struct platform_device *pdev) · line 1193

Quoted 5 lines
drivers/mmc/host/davinci_mmc.c +1 -2
 	r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
 	if (!r)
-		goto out;
-	host->rxdma = r->start;
+		dev_warn(&pdev->dev, "DMA resource not specified\n");

Why not be specific and call it "RX DMA" instead. Anyone who gets this error will have to do that anyway since you have now got two identical error messages.

Agree, I will specify.

Quoted 11 lines

drivers/mmc/host/davinci_mmc.c static int __init davinci_mmcsd_probe(struct platform_device *pdev) · line 1199

Quoted 8 lines
drivers/mmc/host/davinci_mmc.c +3 -2
+	else
+		host->rxdma = r->start;
 
 	r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
 	if (!r)
-		goto out;
-	host->txdma = r->start;
+		dev_warn(&pdev->dev, "DMA resource not specified\n");

"TX DMA" here.

Agree to fix here also.

Thanks,
Prakash

Quoted 3 lines

Thanks,
Sekhar