]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Fix up dma_alloc_coherent() on platforms without cache coherency.
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 27 May 2009 03:50:33 +0000 (13:50 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 27 May 2009 06:33:59 +0000 (16:33 +1000)
commita9e4d4e9e83f761000d5f4935a0aa0cf15dca507
tree046095a0cce051a471c7af93784c024c29a4f99b
parent338428c6804f055c18083e91397c94f0cdf426dd
powerpc: Fix up dma_alloc_coherent() on platforms without cache coherency.

The implementation we just revived has issues, such as using a
Kconfig-defined virtual address area in kernel space that nothing
actually carves out (and thus will overlap whatever is there),
or having some dependencies on being self contained in a single
PTE page which adds unnecessary constraints on the kernel virtual
address space.

This fixes it by using more classic PTE accessors and automatically
locating the area for consistent memory, carving an appropriate hole
in the kernel virtual address space, leaving only the size of that
area as a Kconfig option. It also brings some dma-mask related fixes
from the ARM implementation which was almost identical initially but
grew its own fixes.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/Kconfig
arch/powerpc/include/asm/dma-mapping.h
arch/powerpc/include/asm/pgtable-ppc32.h
arch/powerpc/kernel/dma.c
arch/powerpc/mm/dma-noncoherent.c
arch/powerpc/mm/mem.c