* dma_cache_sync replacement call
@ 2010-12-15 22:54 y bhanu
2010-12-15 22:59 ` Russell King - ARM Linux
0 siblings, 1 reply; 4+ messages in thread
From: y bhanu @ 2010-12-15 22:54 UTC (permalink / raw)
To: linux-arm-kernel
Hi guys,
I am porting a Linux wireless driver from MIPS to ARM (ixp4xx).
As dma_cache_sync() is not implemented for ARM ,I get some nasty errors:
I am not sure whats the replacement for this deprecated call under ARM.
can anyone help figure out what use instread of dma_cache_sync() &
dma_cache_wback_inv() calls?
Missing dma_cache_sync & dma_cache_wback_inv under arch/arm/*
Erorr log
~~~~~~~
if_bus.c:32: error: implicit declaration of function 'dma_cache_sync'
if_bus.c: In function 'bus_map_single':
if_bus.c:49: error: implicit declaration of function 'dma_cache_wback_inv'
if_bus.o] Error 1
make[8]: *** [th_dev] Error 2
Thanks,
Bhan
^ permalink raw reply [flat|nested] 4+ messages in thread
* dma_cache_sync replacement call
2010-12-15 22:54 dma_cache_sync replacement call y bhanu
@ 2010-12-15 22:59 ` Russell King - ARM Linux
2010-12-16 2:08 ` y bhanu
0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2010-12-15 22:59 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Dec 15, 2010 at 02:54:57PM -0800, y bhanu wrote:
> I am porting a Linux wireless driver from MIPS to ARM (ixp4xx).
>
> As dma_cache_sync() is not implemented for ARM ,I get some nasty errors:
> I am not sure whats the replacement for this deprecated call under ARM.
>
> can anyone help figure out what use instread of dma_cache_sync() &
> dma_cache_wback_inv() calls?
The answer is to complain to MIPS people as to why they are using their
own private DMA cache support rather than the DMA API (whose documentation
can be found in Documentation/DMA-API.txt).
The answer is there is no straight replacement - the answer is to fix the
driver to use the proper portable interfaces.
^ permalink raw reply [flat|nested] 4+ messages in thread
* dma_cache_sync replacement call
2010-12-15 22:59 ` Russell King - ARM Linux
@ 2010-12-16 2:08 ` y bhanu
2010-12-16 13:22 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: y bhanu @ 2010-12-16 2:08 UTC (permalink / raw)
To: linux-arm-kernel
Hi Russel,
Here is understanding after reading DMA-API.txt and looking though
different kernel headers (arch specific & generic)
Correct me if I missed anything.
Purpose of dma_cache_sync:
to force sync DMA buffers to be able to be accessed by CPU (programs/driver)
Alternative for dma_cache_sync:
dma_sync_single_for_cpu() and dma_unmap_single()
These do the same operation of (i.e.__dma_single_dev_to_cpu ) to
trasfer the buffer ownership.
But, I really dont understand what is the differnec between
dma_sync_single_for_cpu() and dma_unmap_single()? (Is it is just to
make the name clear?)
I think dma_sync_single_for_cpu() bests suites to situation.
Thanks
bhanu
On Wed, Dec 15, 2010 at 2:59 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Wed, Dec 15, 2010 at 02:54:57PM -0800, y bhanu wrote:
>> I am porting a Linux wireless driver from MIPS to ARM (ixp4xx).
>>
>> As dma_cache_sync() is not implemented for ARM ,I get some nasty errors:
>> I am not sure whats the replacement for this deprecated call under ARM.
>>
>> can ?anyone help figure out what use instread of dma_cache_sync() &
>> dma_cache_wback_inv() calls?
>
> The answer is to complain to MIPS people as to why they are using their
> own private DMA cache support rather than the DMA API (whose documentation
> can be found in Documentation/DMA-API.txt).
>
> The answer is there is no straight replacement - the answer is to fix the
> driver to use the proper portable interfaces.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* dma_cache_sync replacement call
2010-12-16 2:08 ` y bhanu
@ 2010-12-16 13:22 ` Arnd Bergmann
0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2010-12-16 13:22 UTC (permalink / raw)
To: linux-arm-kernel
On Thursday 16 December 2010, y bhanu wrote:
> Alternative for dma_cache_sync:
> dma_sync_single_for_cpu() and dma_unmap_single()
> These do the same operation of (i.e.__dma_single_dev_to_cpu ) to
> trasfer the buffer ownership.
>
> But, I really dont understand what is the differnec between
> dma_sync_single_for_cpu() and dma_unmap_single()? (Is it is just to
> make the name clear?)
> I think dma_sync_single_for_cpu() bests suites to situation.
The difference is mainly on platforms with an IOMMU, where you have
to explicitly manage the bus addresses using dma_map_* / dma_unmap_*.
dma_sync_single_for_cpu is for cases where you have a long-lived
(mapping with multiple accesses from both CPU and device, e.g. doing
dma_map_single(); /* gives returns a dma address
and allows the device to access it */
while (running) {
dma_sync_single_for_cpu(); /* lets the CPU access the buffer */
dma_sync_single_for_device(); /* lets the device access the buffer */
}
dma_unmap_single(); /* invalidates the dma address and returns it
to the CPU */
If the device only accesses the buffer once, you don't need to do an
explicit sync at all, just unmap after the access is done.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-16 13:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-15 22:54 dma_cache_sync replacement call y bhanu
2010-12-15 22:59 ` Russell King - ARM Linux
2010-12-16 2:08 ` y bhanu
2010-12-16 13:22 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox