Skip to contentSkip to conversation

spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

PATCH RESEND Superseded Viresh Kumar 3 participants 6 messages May 16, 2011 – May 19, 2011 SPI

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

If pl022_dma_probe fails, we can try to transfer data in polling or interrupt mode. Also, set platform_info->enable_dma to 0, so that no other code tries to use dma.

---
 drivers/spi/amba-pl022.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
drivers/spi/amba-pl022.c +6 -5
index dae886e..77f90de 100644
@@ -1068,7 +1068,7 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
 					    pl022->master_info->dma_filter,
 					    pl022->master_info->dma_rx_param);
 	if (!pl022->dma_rx_channel) {
-		dev_err(&pl022->adev->dev, "no RX DMA channel!\n");
+		dev_dbg(&pl022->adev->dev, "no RX DMA channel!\n");
 		goto err_no_rxchan;
 	}
 
@@ -1076,13 +1076,13 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
 					    pl022->master_info->dma_filter,
 					    pl022->master_info->dma_tx_param);
 	if (!pl022->dma_tx_channel) {
-		dev_err(&pl022->adev->dev, "no TX DMA channel!\n");
+		dev_dbg(&pl022->adev->dev, "no TX DMA channel!\n");
 		goto err_no_txchan;
 	}
 
 	pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL);
 	if (!pl022->dummypage) {
-		dev_err(&pl022->adev->dev, "no DMA dummypage!\n");
+		dev_dbg(&pl022->adev->dev, "no DMA dummypage!\n");
 		goto err_no_dummypage;
 	}
 
@@ -1098,6 +1098,8 @@ err_no_txchan:
 	dma_release_channel(pl022->dma_rx_channel);
 	pl022->dma_rx_channel = NULL;
 err_no_rxchan:
+	dev_err(&pl022->adev->dev,
+			"Failed to work in dma mode, work without dma!\n");
 	return -ENODEV;
 }
 
@@ -2111,7 +2113,7 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
 	if (platform_info->enable_dma) {
 		status = pl022_dma_probe(pl022);
 		if (status != 0)
-			goto err_no_dma;
+			platform_info->enable_dma = 0;
 	}
 
 	/* Initialize and start queue */
@@ -2143,7 +2145,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
  err_init_queue:
 	destroy_queue(pl022);
 	pl022_dma_remove(pl022);
- err_no_dma:
 	free_irq(adev->irq[0], pl022);
  err_no_irq:
 	clk_put(pl022->clk);
Signature · 1 line
1.7.2.2
#2 lore raw

PATCH RESEND 1/1 spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

Quoted 8 lines · Russell King - ARM Linux
Quoted 6 lines · Viresh Kumar
Quoted 6 lines

If pl022_dma_probe fails, we can try to transfer data in polling or interrupt mode. Also, set platform_info->enable_dma to 0, so that no other code tries to use dma.

Shouldn't this go via the SPI people rather than my tree?

This can, but i have seen amba drivers patches going through your drivers branch, so sent to tracker. Should i get them through spi-devel??

Signature · 1 line
viresh
#3 lore raw

PATCH RESEND 1/1 spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

Quoted 6 lines · viresh kumar
Quoted 5 lines · Russell King - ARM Linux
Quoted 4 lines · Viresh Kumar
Quoted 4 lines

If pl022_dma_probe fails, we can try to transfer data in polling or interrupt mode. Also, set platform_info->enable_dma to 0, so that no other code tries to use dma.

Quoted 6 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

Shouldn't this go via the SPI people rather than my tree?

This can, but i have seen amba drivers patches going through your drivers branch, so sent to tracker.

Yes, because I authored quite a few primecell drivers, and I continue to maintain those drivers. The SPI driver is not one of those though.

Quoted 1 line

Should i get them through spi-devel??

Yes please.

#4 lore raw

PATCH RESEND 1/1 spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

In reply to Viresh Kumar
Quoted 10 lines · Viresh KUMAR

If pl022_dma_probe fails, we can try to transfer data in polling or interrupt mode. Also, set platform_info->enable_dma to 0, so that no other code tries to use dma.

---
 drivers/spi/amba-pl022.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

David,

Sorry for missing you earlier in "to" list. Can you please push this through spi-devel tree.

--
viresh

Quoted 55 lines
drivers/spi/amba-pl022.c +6 -5
index dae886e..77f90de 100644
@@ -1068,7 +1068,7 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
 					    pl022->master_info->dma_filter,
 					    pl022->master_info->dma_rx_param);
 	if (!pl022->dma_rx_channel) {
-		dev_err(&pl022->adev->dev, "no RX DMA channel!\n");
+		dev_dbg(&pl022->adev->dev, "no RX DMA channel!\n");
 		goto err_no_rxchan;
 	}
 
@@ -1076,13 +1076,13 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
 					    pl022->master_info->dma_filter,
 					    pl022->master_info->dma_tx_param);
 	if (!pl022->dma_tx_channel) {
-		dev_err(&pl022->adev->dev, "no TX DMA channel!\n");
+		dev_dbg(&pl022->adev->dev, "no TX DMA channel!\n");
 		goto err_no_txchan;
 	}
 
 	pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL);
 	if (!pl022->dummypage) {
-		dev_err(&pl022->adev->dev, "no DMA dummypage!\n");
+		dev_dbg(&pl022->adev->dev, "no DMA dummypage!\n");
 		goto err_no_dummypage;
 	}
 
@@ -1098,6 +1098,8 @@ err_no_txchan:
 	dma_release_channel(pl022->dma_rx_channel);
 	pl022->dma_rx_channel = NULL;
 err_no_rxchan:
+	dev_err(&pl022->adev->dev,
+			"Failed to work in dma mode, work without dma!\n");
 	return -ENODEV;
 }
 
@@ -2111,7 +2113,7 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
 	if (platform_info->enable_dma) {
 		status = pl022_dma_probe(pl022);
 		if (status != 0)
-			goto err_no_dma;
+			platform_info->enable_dma = 0;
 	}
 
 	/* Initialize and start queue */
@@ -2143,7 +2145,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
  err_init_queue:
 	destroy_queue(pl022);
 	pl022_dma_remove(pl022);
- err_no_dma:
 	free_irq(adev->irq[0], pl022);
  err_no_irq:
 	clk_put(pl022->clk);
Signature · 1 line
viresh
Applied
#5 lore raw

PATCH RESEND 1/1 spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

In reply to Viresh Kumar
Quoted 6 lines · Viresh Kumar

If pl022_dma_probe fails, we can try to transfer data in polling or interrupt mode. Also, set platform_info->enable_dma to 0, so that no other code tries to use dma.

Merged, thanks.

g.

Quoted 73 lines
---
 drivers/spi/amba-pl022.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
drivers/spi/amba-pl022.c +6 -5
index dae886e..77f90de 100644
@@ -1068,7 +1068,7 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
 					    pl022->master_info->dma_filter,
 					    pl022->master_info->dma_rx_param);
 	if (!pl022->dma_rx_channel) {
-		dev_err(&pl022->adev->dev, "no RX DMA channel!\n");
+		dev_dbg(&pl022->adev->dev, "no RX DMA channel!\n");
 		goto err_no_rxchan;
 	}
 
@@ -1076,13 +1076,13 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
 					    pl022->master_info->dma_filter,
 					    pl022->master_info->dma_tx_param);
 	if (!pl022->dma_tx_channel) {
-		dev_err(&pl022->adev->dev, "no TX DMA channel!\n");
+		dev_dbg(&pl022->adev->dev, "no TX DMA channel!\n");
 		goto err_no_txchan;
 	}
 
 	pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL);
 	if (!pl022->dummypage) {
-		dev_err(&pl022->adev->dev, "no DMA dummypage!\n");
+		dev_dbg(&pl022->adev->dev, "no DMA dummypage!\n");
 		goto err_no_dummypage;
 	}
 
@@ -1098,6 +1098,8 @@ err_no_txchan:
 	dma_release_channel(pl022->dma_rx_channel);
 	pl022->dma_rx_channel = NULL;
 err_no_rxchan:
+	dev_err(&pl022->adev->dev,
+			"Failed to work in dma mode, work without dma!\n");
 	return -ENODEV;
 }
 
@@ -2111,7 +2113,7 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
 	if (platform_info->enable_dma) {
 		status = pl022_dma_probe(pl022);
 		if (status != 0)
-			goto err_no_dma;
+			platform_info->enable_dma = 0;
 	}
 
 	/* Initialize and start queue */
@@ -2143,7 +2145,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
  err_init_queue:
 	destroy_queue(pl022);
 	pl022_dma_remove(pl022);
- err_no_dma:
 	free_irq(adev->irq[0], pl022);
  err_no_irq:
 	clk_put(pl022->clk);
Signature · 13 lines
1.7.2.2


------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
spi-devel-general mailing list
spi-devel-general at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general