Re: [QUERY] amba/pl022: DMA channel allocation always fail.

2011-05-15 Thread viresh kumar
On 05/13/2011 08:01 PM, Linus Walleij wrote:
> 2011/5/13 viresh kumar :
> 
>> amba/pl022 and my dma driver dw_dmac.c, both have registered init() routines
>> with subsys_initcall(). Now at bootup, spi boots up before DMA and so DMA
>> channels are never available at spi probe.
>>
>> What should be done to solve this issue?
> 
> If you check drivers/dma/ste_dma40.c you can see that our solution was to
> simply move the DMA engine to arch_initcall().
> 
> Which sort of makes sense for a DMA engine.
> 
> Does this work for dw_dmac.c?

Yes, it worked here too..

-- 
viresh

--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


[PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

2011-05-15 Thread 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.

Signed-off-by: Viresh Kumar 
Acked-by: Linus Walleij 
---
 drivers/spi/amba-pl022.c |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
index dae886e..77f90de 100644
--- a/drivers/spi/amba-pl022.c
+++ b/drivers/spi/amba-pl022.c
@@ -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);
-- 
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


[SPAM] 发/票――代/开

2011-05-15 Thread 13642347266
您好:
我公司在(深圳市、东莞市、广州市等)有一部分专用发――票代开;
如:(1)普通商品销售发―票;
   (2)广告业、各类服务业发――票等等。
 
如有需要,欢迎您与我联系:  
负责人:张先生(0)13642347266

--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Sito di protesta fiscale Contro equitalia ( FurtItalia)

2011-05-15 Thread No-equitalia
Fai parte anche tu di
Italia che lavora.
Sito di protesta fiscale
Contro l'oppressione fiscale
Contro equitalia ( Furtitalia)
Inoltra questo msg ai tuoi amici
Per visionare il sito clicca qui
--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general