dma-mapping: Allow mixing bypass and mapped DMA operation
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Thu, 29 Oct 2020 01:52:40 +0000 (12:52 +1100)
committerChristoph Hellwig <hch@lst.de>
Fri, 27 Nov 2020 09:33:40 +0000 (10:33 +0100)
commit8d8d53cf8fd028310b1189165b939cde124895d7
treef1aab854df1f06f0604eb240adf21937c5bc6bc6
parent418baf2c28f3473039f2f7377760bd8f6897ae18
dma-mapping: Allow mixing bypass and mapped DMA operation

At the moment we allow bypassing DMA ops only when we can do this for
the entire RAM. However there are configs with mixed type memory
where we could still allow bypassing IOMMU in most cases;
POWERPC with persistent memory is one example.

This adds an arch hook to determine where bypass can still work and
we invoke direct DMA API. The following patch checks the bus limit
on POWERPC to allow or disallow direct mapping.

This adds a ARCH_HAS_DMA_MAP_DIRECT config option to make the arch_xxxx
hooks no-op by default.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Christoph Hellwig <hch@lst.de>
include/linux/dma-map-ops.h
kernel/dma/Kconfig
kernel/dma/mapping.c