linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [QUERY] amba/pl022: DMA channel allocation always fail.
@ 2011-05-13 12:01 viresh kumar
  2011-05-13 14:31 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: viresh kumar @ 2011-05-13 12:01 UTC (permalink / raw)
  To: linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	"spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
  Cc: Armando VISCONTI, Shiraz HASHIM

Linus,

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?

One idea is allocate DMA channel as and when required, instead of allocating them
at probe. But in that case too i am not sure, that this issue will be solved.
As, if spi slave device is added from board file, then it will also try to transfer
data as soon as spi driver is up. So that too may be called before dma_probe().

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [QUERY] amba/pl022: DMA channel allocation always fail.
  2011-05-13 12:01 [QUERY] amba/pl022: DMA channel allocation always fail viresh kumar
@ 2011-05-13 14:31 ` Linus Walleij
       [not found]   ` <BANLkTinMH9TpTTzqoMPS7JZUBRss3pScWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2011-05-13 14:31 UTC (permalink / raw)
  To: viresh kumar
  Cc: Armando VISCONTI, spi-devel-general@lists.sourceforge.net,
	viresh kumar, linux-arm-kernel@lists.infradead.org, Shiraz HASHIM

2011/5/13 viresh kumar <viresh.kumar@st.com>:

> 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?

> One idea is allocate DMA channel as and when required, instead of allocating them
> at probe. But in that case too i am not sure, that this issue will be solved.

For the serial port I've added a real funny tweak to queue the ports
and add DMA later since these are initialized very early.

Check in drivers/tty/serial/amba-pl011.c

Hope this helps,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [QUERY] amba/pl022: DMA channel allocation always fail.
       [not found]   ` <BANLkTinMH9TpTTzqoMPS7JZUBRss3pScWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-05-16  4:45     ` viresh kumar
  0 siblings, 0 replies; 3+ messages in thread
From: viresh kumar @ 2011-05-16  4:45 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Armando VISCONTI,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Shiraz HASHIM

On 05/13/2011 08:01 PM, Linus Walleij wrote:
> 2011/5/13 viresh kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>:
> 
>> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-16  4:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13 12:01 [QUERY] amba/pl022: DMA channel allocation always fail viresh kumar
2011-05-13 14:31 ` Linus Walleij
     [not found]   ` <BANLkTinMH9TpTTzqoMPS7JZUBRss3pScWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-16  4:45     ` viresh kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).