Re: [PATCH] powerpc: Implement dma_mmap_coherent()
From: Gerhard Pircher <hidden>
Date: 2011-03-31 20:39:29
-------- Original-Nachricht --------
Datum: Fri, 25 Mar 2011 17:50:06 +1100 Von: Benjamin Herrenschmidt [off-list ref] An: linuxppc-dev [off-list ref] CC: Takashi Iwai <redacted> 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@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! regards, Gerhard -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone