[PATCH] powerpc: Implement dma_mmap_coherent()

Gerhard Pircher gerhard_pircher at gmx.net
Fri Apr 1 07:39:21 EST 2011

-------- Original-Nachricht --------
> Datum: Fri, 25 Mar 2011 17:50:06 +1100
> Von: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> An: linuxppc-dev <linuxppc-dev at lists.ozlabs.org>
> CC: Takashi Iwai <tiwai at suse.de>
> Betreff: [PATCH] powerpc: Implement dma_mmap_coherent()

> This is used by Alsa to mmap buffers allocated with dma_alloc_coherent()
> into userspace. We need a special variant to handle machines with
> non-coherent DMAs as those buffers have "special" virt addresses and
> require non-cachable mappings
> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> ---
> Dunno if anybody with CONFIG_NOT_COHERENT_CACHE has some audio device
> that uses dma buffers (ie not usb-audio) and wants to try that out...
> should fix a long standing problem.

Compilation fails here with these error messages:

>   CC      arch/powerpc/mm/dma-noncoherent.o
> arch/powerpc/mm/dma-noncoherent.c: In function ‘__dma_get_coherent_pfn’:
> arch/powerpc/mm/dma-noncoherent.c:413: error: invalid operands to binary >> (have ‘void *’ and ‘int’)
> cc1: warnings being treated as errors
> arch/powerpc/mm/dma-noncoherent.c:414: error: passing argument 2 of ‘pud_offset’ makes integer from pointer without a cast
> arch/powerpc/mm/dma-noncoherent.c:415: error: passing argument 2 of ‘pmd_offset’ makes integer from pointer without a cast
> arch/powerpc/mm/dma-noncoherent.c:416: error: invalid operands to binary >> (have ‘void *’ and ‘int’)
> make[1]: *** [arch/powerpc/mm/dma-noncoherent.o] Fehler 1
> make: *** [arch/powerpc/mm] Fehler 2

Anyway, it compiles with explicit type casts and I could test it on my
semi-noncoherent AmigaOne. So far it works just fine with the VIA onboard
sound and a Soundblaster Live PCI card.

Thanks a lot for the fix!


NEU: FreePhone - kostenlos mobil telefonieren und surfen!			
Jetzt informieren: http://www.gmx.net/de/go/freephone

More information about the Linuxppc-dev mailing list