]> git.baikalelectronics.ru Git - kernel.git/commit
dma-direct: provide mmap and get_sgtable method overrides
authorChristoph Hellwig <hch@lst.de>
Tue, 29 Oct 2019 10:01:37 +0000 (11:01 +0100)
committerChristoph Hellwig <hch@lst.de>
Mon, 11 Nov 2019 09:52:15 +0000 (10:52 +0100)
commita49b075b53fb22e43c33a7ff06357008d40d2ae2
treef6d10010989435562d0ece0971ed992febe6c26c
parent8bba21f2c40f599bbcb3eae96b3217e4b24fe856
dma-direct: provide mmap and get_sgtable method overrides

For dma-direct we know that the DMA address is an encoding of the
physical address that we can trivially decode.  Use that fact to
provide implementations that do not need the arch_dma_coherent_to_pfn
architecture hook.  Note that we still can only support mmap of
non-coherent memory only if the architecture provides a way to set an
uncached bit in the page tables.  This must be true for architectures
that use the generic remap helpers, but other architectures can also
manually select it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
16 files changed:
arch/arc/Kconfig
arch/arm/Kconfig
arch/arm/mm/dma-mapping.c
arch/arm64/Kconfig
arch/ia64/Kconfig
arch/ia64/kernel/dma-mapping.c
arch/microblaze/Kconfig
arch/mips/Kconfig
arch/mips/mm/dma-noncoherent.c
arch/powerpc/platforms/Kconfig.cputype
include/linux/dma-direct.h
include/linux/dma-noncoherent.h
kernel/dma/Kconfig
kernel/dma/direct.c
kernel/dma/mapping.c
kernel/dma/remap.c