[PATCH 29/67] dma-direct: use node local allocations for coherent memory

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/dma-direct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dma-direct.c b/lib/dma-direct.c index d0266b39788b..ab81de3ac1d3 100644 --- a/lib/dma-direct.c +++ b/lib/dma-direct.c @@ -39,7 +39,7 @@ stati

[PATCH 45/67] swiotlb: rename swiotlb_free to swiotlb_exit

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/powerpc/kernel/dma-swiotlb.c | 2 +- arch/x86/kernel/pci-swiotlb.c | 2 +- include/linux/swiotlb.h | 4 ++-- lib/swiotlb.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/p

[PATCH 51/67] set_memory.h: provide set_memory_{en,de}crypted stubs

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/linux/set_memory.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/set_memory.h b/include/linux/set_memory.h index e5140648f638..da5178216da5 100644 --- a/include/linux/set_memory.h +++ b/include

[PATCH 37/67] x86: use dma-direct

2017-12-29 Thread Christoph Hellwig
fairly questionable for at least some of them. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/Kconfig | 1 + arch/x86/include/asm/dma-mapping.h | 8 - arch/x86/include/asm/iommu.h | 3 -- arch/x86/kernel/Makefile | 2 +- arch/x86/

[PATCH 39/67] iommu/amd_iommu: use dma_direct_* helpers for the direct mapping case

2017-12-29 Thread Christoph Hellwig
This adds support for CMA allocations, but is otherwise identical. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/iommu/Kconfig | 1 + drivers/iommu/amd_iommu.c | 27 +-- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers

[PATCH 41/67] x86: remove dma_alloc_coherent_gfp_flags

2017-12-29 Thread Christoph Hellwig
All dma_ops implementations used on x86 now take care of setting their own required GFP_ masks for the allocation. And given that the common code now clears harmful flags itself that means we can stop the flags in all the iommu implementations as well. Signed-off-by: Christoph Hellwig &l

[PATCH 59/67] unicore32: use generic swiotlb_ops

2017-12-29 Thread Christoph Hellwig
These are identical to the unicore32 ops, and would also support CMA if enabled on unicore32. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/unicore32/include/asm/dma-mapping.h | 9 +- arch/unicore32/mm/Kconfig| 1 + arch/unicore32/mm/Makefile

[PATCH 58/67] ia64: remove an ifdef around the content of pci-dma.c

2017-12-29 Thread Christoph Hellwig
The file is only compiled if CONFIG_INTEL_IOMMU is set to start with. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/ia64/kernel/pci-dma.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c index 35e0cad33b7d..b5df08

[PATCH 33/67] dma-direct: reject too small dma masks

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/linux/dma-direct.h | 1 + lib/dma-direct.c | 19 +++ 2 files changed, 20 insertions(+) diff --git a/include/linux/dma-direct.h b/include/linux/dma-direct.h index 4788bf0bf683..bcdb1a3e4b1f 100644 --- a/i

[PATCH 65/67] arm64: use swiotlb_alloc and swiotlb_free

2017-12-29 Thread Christoph Hellwig
The generic swiotlb_alloc and swiotlb_free routines already take care of CMA allocations and adding GFP_DMA32 where needed, so use them instead of the arm specific helpers. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm64/Kconfig | 1 + arch/arm64/mm/dma-mapping.

[PATCH 54/67] x86: remove sta2x11_dma_ops

2017-12-29 Thread Christoph Hellwig
Both the swiotlb and the dma-direct code already call into phys_to_dma to translate the DMA address. So the sta2x11 into phys_to_dma and dma_to_phys are enough to handle this "special" device, and we can use the plain old swiotlb ops. Signed-off-by: Christoph Hellwig <h...@lst.de&g

[PATCH 40/67] iommu/intel-iommu: use dma_direct_* helpers for the direct mapping case

2017-12-29 Thread Christoph Hellwig
This simplifies the code a bit, and prepares for future cleanups. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/iommu/Kconfig | 1 + drivers/iommu/intel-iommu.c | 17 - 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/Kco

[PATCH 67/67] swiotlb: remove various exports

2017-12-29 Thread Christoph Hellwig
All these symbols are only used by arch dma_ops implementations or xen-swiotlb. None of which can be modular. Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/swiotlb.c | 13 - 1 file changed, 13 deletions(-) diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 77a40b

[PATCH 66/67] swiotlb: remove swiotlb_{alloc,free}_coherent

2017-12-29 Thread Christoph Hellwig
Unused now that everyone uses swiotlb_{alloc,free}. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/linux/swiotlb.h | 8 lib/swiotlb.c | 41 - 2 files changed, 49 deletions(-) diff --git a/include/linux/swiotlb.h b/i

[PATCH 44/67] powerpc: rename swiotlb_dma_ops

2017-12-29 Thread Christoph Hellwig
We'll need that name for a generic implementation soon. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/powerpc/include/asm/swiotlb.h | 2 +- arch/powerpc/kernel/dma-swiotlb.c | 4 ++-- arch/powerpc/kernel/dma.c | 2 +- arch/powerpc/sysdev/fsl_pci.c | 2 +- 4 files c

[PATCH 34/67] cris: use dma-direct

2017-12-29 Thread Christoph Hellwig
cris currently has an incomplete direct mapping dma_map_ops implementation is PCI support is enabled. Replace it with the fully feature generic dma-direct implementation. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/cris/Kconfig | 4 ++ arch/cris/ar

[PATCH 38/67] x86/amd_gart: clean up gart_alloc_coherent

2017-12-29 Thread Christoph Hellwig
Don't rely on the gfp mask from dma_alloc_coherent_gfp_flags to make the fallback decision, and streamline the code flow a bit. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/kernel/amd_gart_64.c | 36 ++-- 1 file changed, 18 insertions(

[PATCH 32/67] dma-direct: add support for allocation from ZONE_DMA and ZONE_DMA32

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/dma-direct.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/lib/dma-direct.c b/lib/dma-direct.c index 7e913728e099..2e9b9494610c 100644 --- a/lib/dma-direct.c +++ b/lib/dma-direct.c @@ -12,6 +12,14 @@ #

[PATCH 47/67] swiotlb: wire up ->dma_supported in swiotlb_dma_ops

2017-12-29 Thread Christoph Hellwig
To properly reject too small DMA masks based on the addressability of the bounce buffer. Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/swiotlb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 9c100f0173bf..e0b8980334c3 100644 --- a/lib/swi

[PATCH 57/67] ia64: clean up swiotlb support

2017-12-29 Thread Christoph Hellwig
Move the few remaining bits of swiotlb glue towards their callers, and remove the pointless on ia64 swiotlb variable. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/ia64/include/asm/dma-mapping.h | 1 - arch/ia64/include/asm/swiotlb.h | 18 -- arch/ia64/kern

[PATCH 30/67] dma-direct: retry allocations using GFP_DMA for small masks

2017-12-29 Thread Christoph Hellwig
If we got back an allocation that wasn't inside the support coherent mask, retry the allocation using GFP_DMA. Based on the x86 code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/dma-direct.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff

[PATCH 53/67] swiotlb: remove swiotlb_set_mem_attributes

2017-12-29 Thread Christoph Hellwig
Now that set_memory_decrypted is always available we can just call it directly. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/include/asm/mem_encrypt.h | 2 -- arch/x86/mm/mem_encrypt.c | 9 - lib/swiotlb.c | 12 ++-- 3 files c

[PATCH 60/67] tile: replace ZONE_DMA with ZONE_DMA32

2017-12-29 Thread Christoph Hellwig
tile uses ZONE_DMA for allocations below 32-bits. These days we name the zone for that ZONE_DMA32, which will allow to use the dma-direct and generic swiotlb code as-is, so rename it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/tile/Kconfig | 2 +- arch/tile/kern

[PATCH 35/67] h8300: use dma-direct

2017-12-29 Thread Christoph Hellwig
Replace the bare-bones h8300 direct dma mapping implementation with the fully featured generic dma-direct one. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/h8300/Kconfig | 1 + arch/h8300/include/asm/Kbuild| 1 + arch/h8300/include/asm/dma-mapping.

[PATCH 62/67] mips/netlogic: remove swiotlb support

2017-12-29 Thread Christoph Hellwig
nlm_swiotlb_dma_ops is unused code, so the whole swiotlb support is dead. If it gets resurrected at some point it should use the generic swiotlb_dma_ops instead. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/mips/include/asm/netlogic/common.h | 3 -- arch/mips/netlogic/K

[PATCH 48/67] swiotlb: rely on dev->coherent_dma_mask

2017-12-29 Thread Christoph Hellwig
These days the coherent DMA mask is always set, so don't work around the lack of it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/swiotlb.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/swiotlb.c b/lib/swiotlb.c index e0b8980334c3..a14fff

[PATCH 55/67] ia64: replace ZONE_DMA with ZONE_DMA32

2017-12-29 Thread Christoph Hellwig
ia64 uses ZONE_DMA for allocations below 32-bits. These days we name the zone for that ZONE_DMA32, which will allow to use the dma-direct and generic swiotlb code as-is, so rename it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/ia64/Kconfig | 2 +- arch/ia64/kern

[PATCH 64/67] arm64: replace ZONE_DMA with ZONE_DMA32

2017-12-29 Thread Christoph Hellwig
arm64 uses ZONE_DMA for allocations below 32-bits. These days we name the zone for that ZONE_DMA32, which will allow to use the dma-direct and generic swiotlb code as-is, so rename it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm64/Kconfig | 2 +- arch/arm64/

[PATCH 52/67] dma-direct: handle the memory encryption bit in common code

2017-12-29 Thread Christoph Hellwig
non-encrypted bounce buffers, and the x86 SEV case can use the generic swiotlb ops. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/include/asm/dma-direct.h | 4 +- arch/mips/cavium-octeon/dma-octeon.c | 10 +-- .../include/asm/mach-cavium-octe

[PATCH 46/67] swiotlb: lift x86 swiotlb_dma_ops to common code

2017-12-29 Thread Christoph Hellwig
Including the useful helpers for coherent allocations that first try the full blown direct mapping. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/include/asm/swiotlb.h | 8 arch/x86/kernel/pci-swiotlb.c | 45 -- arch/x

[PATCH 56/67] ia64: use generic swiotlb_ops

2017-12-29 Thread Christoph Hellwig
These are identical to the ia64 ops, and would also support CMA if enabled on ia64. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/ia64/Kconfig| 5 + arch/ia64/hp/common/hwsw_iommu.c | 4 ++-- arch/ia64/hp/common/sba_iommu.c | 6 +++--- arch/ia64/kern

[PATCH 50/67] swiotlb: refactor coherent buffer allocation

2017-12-29 Thread Christoph Hellwig
Factor out a new swiotlb_alloc_buffer helper that allocates DMA coherent memory from the swiotlb bounce buffer. This allows to simplify the swiotlb_alloc implemenation that uses dma_direct_alloc to try to allocate a reachable buffer first. Signed-off-by: Christoph Hellwig <h...@lst.de> --

[PATCH 36/67] x86: remove dma_alloc_coherent_mask

2017-12-29 Thread Christoph Hellwig
These days all devices (including the ISA fallback device) have a coherent DMA mask set, so remove the workaround. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/include/asm/dma-mapping.h | 18 ++ arch/x86/kernel/pci-dma.c | 10 -- arch/

[PATCH 31/67] dma-direct: make dma_direct_{alloc, free} available to other implementations

2017-12-29 Thread Christoph Hellwig
So that they don't need to indirect through the operation vector. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/mm/dma-mapping-nommu.c | 9 +++-- include/linux/dma-direct.h | 5 + lib/dma-direct.c| 6 +++--- 3 files changed, 11 insertions

[PATCH 16/67] powerpc: rename dma_direct_ to dma_nommu_

2017-12-29 Thread Christoph Hellwig
We want to use the dma_direct_ namespace for a generic implementation, so rename powerpc to the second best choice: dma_nommu_. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/powerpc/include/asm/dma-mapping.h| 8 ++-- arch/powerpc/kernel/dma-iommu.c | 2 +- arch/p

[PATCH 18/67] microblaze: remove dma_nommu_dma_supported

2017-12-29 Thread Christoph Hellwig
Always returning 1 is the same behavior as not supplying a method at all. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/microblaze/kernel/dma.c | 6 -- arch/parisc/kernel/pci-dma.c | 7 --- 2 files changed, 13 deletions(-) diff --git a/arch/microblaze/kernel/dma.c

[PATCH 17/67] microblaze: rename dma_direct to dma_microblaze

2017-12-29 Thread Christoph Hellwig
This frees the dma_direct_* namespace for a generic implementation. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/microblaze/include/asm/dma-mapping.h | 4 +-- arch/microblaze/kernel/dma.c | 50 +++ 2 files changed, 27 insertions(

[PATCH 13/67] dma-mapping: move swiotlb arch helpers to a new header

2017-12-29 Thread Christoph Hellwig
that provides the default linear mapping unless the architecture wants to override it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- MAINTAINERS| 1 + arch/Kconfig | 4 +++ arch/arm/K

[PATCH 19/67] microblaze: remove the dead !NOT_COHERENT_CACHE dma code

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/microblaze/kernel/dma.c | 28 1 file changed, 28 deletions(-) diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c index 49b09648679b..031d889670f5 100644 --- a/arch/microblaze/kernel

[PATCH 15/67] hexagon: use the generic dma_capable helper

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/hexagon/include/asm/dma-mapping.h | 7 --- arch/hexagon/kernel/dma.c | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/hexagon/include/asm/dma-mapping.h b/arch/hexagon/include/asm/dma-mapping.h

[PATCH 08/67] powerpc: remove unused flush_write_buffers definition

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/powerpc/include/asm/dma-mapping.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 5a6cbe11db6f..592c7f418aa0 100644 --- a/arch/powerpc/inclu

[PATCH 02/67] alpha: mark jensen as broken

2017-12-29 Thread Christoph Hellwig
CONFIG_ALPHA_JENSEN has failed to compile since commit aca05038 ("alpha/dma: use common noop dma ops"), so mark it as broken. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/alpha/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/alpha/Kconfig b/arch/alp

[PATCH 04/67] arm64: don't override dma_max_pfn

2017-12-29 Thread Christoph Hellwig
The generic version now takes dma_pfn_offset into account, so there is no more need for an architecture override. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm64/include/asm/dma-mapping.h | 9 - 1 file changed, 9 deletions(-) diff --git a/arch/arm64/include/a

[PATCH 03/67] dma-mapping: take dma_pfn_offset into account in dma_max_pfn

2017-12-29 Thread Christoph Hellwig
This makes sure the generic version can be used with architectures / devices that have a DMA offset in the direct mapping. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/linux/dma-mapping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/lin

[PATCH 01/67] x86: remove X86_PPRO_FENCE

2017-12-29 Thread Christoph Hellwig
There were only a few Pentium Pro multiprocessors systems where this errata applied. They are more than 20 years old now, and we've slowly dropped places where put the workarounds in and discuraged anyone from enabling the workaround. Get rid of it for good. Signed-off-by: Christoph Hellwig &l

[PATCH 05/67] dma-mapping: replace PCI_DMA_BUS_IS_PHYS with a flag in struct dma_map_ops

2017-12-29 Thread Christoph Hellwig
modern driver has these, but there might still be a few outdated legacy drivers out there, which now won't make an intelligent decision. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/alpha/include/asm/pci.h | 5 - arch/alpha/kernel/pci-noop.c | 1 + ar

[PATCH 12/67] s390: remove the unused dma_capable helper

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/s390/include/asm/dma-mapping.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/arch/s390/include/asm/dma-mapping.h b/arch/s390/include/asm/dma-mapping.h index eaf490f9c5bc..2ec7240c1ada 100644 --- a/arch/s390/include/a

[PATCH 10/67] m32r: remove the unused dma_capable helper

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/m32r/include/asm/dma-mapping.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/arch/m32r/include/asm/dma-mapping.h b/arch/m32r/include/asm/dma-mapping.h index 336ffe60814b..8967fb659691 100644 --- a/arch/m32r/include/a

consolidate direct dma mapping and swiotlb support

2017-12-29 Thread Christoph Hellwig
Almost every architecture supports a direct dma mapping implementation, where no iommu is used and the device dma address is a 1:1 mapping to the physical address or has a simple linear offset. Currently the code for this implementation is most duplicated over the architectures, and the

[PATCH 24/67] dma-mapping: provide a generic asm/dma-mapping.h

2017-12-29 Thread Christoph Hellwig
For architectures that just use the generic dma_noop_ops we can provide a generic version of dma-mapping.h. Signed-off-by: Christoph Hellwig <h...@lst.de> --- MAINTAINERS | 1 + arch/m32r/include/asm/Kbuild | 1 + arch/m32r/include/asm/dma-mapping.h

[PATCH 28/67] dma-direct: add support for CMA allocation

2017-12-29 Thread Christoph Hellwig
Try the CMA allocator for coherent allocations if supported. Roughly modelled after the x86 code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/dma-direct.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/dma-direct.c b/lib/dma-di

[PATCH 27/67] dma-direct: add dma address sanity checks

2017-12-29 Thread Christoph Hellwig
Roughly based on the x86 pci-nommu implementation. Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/dma-direct.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/lib/dma-direct.c b/lib/dma-direct.c index 0e087650e86b..ddd9dcf4e663

[PATCH 09/67] arc: remove CONFIG_ARC_PLAT_NEEDS_PHYS_TO_DMA

2017-12-29 Thread Christoph Hellwig
We always use the stub definitions, so remove the unused other code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arc/Kconfig | 3 --- arch/arc/include/asm/dma-mapping.h | 7 --- arch/arc/mm/dma.c | 14 +++--- 3 files chan

[PATCH 11/67] riscv: remove the unused dma_capable helper

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/riscv/include/asm/dma-mapping.h | 8 1 file changed, 8 deletions(-) diff --git a/arch/riscv/include/asm/dma-mapping.h b/arch/riscv/include/asm/dma-mapping.h index 3eec1000196d..73849e2cc761 100644 --- a/arch/riscv/include/a

[PATCH 14/67] dma-mapping: move dma_mark_clean to dma-direct.h

2017-12-29 Thread Christoph Hellwig
And unlike the other helpers we don't require a as this helper is a special case for ia64 only, and this keeps it as simple as possible. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/include/asm/dma-mapping.h | 2 -- arch/arm64/include/asm/dma-mapping.h | 4

[PATCH 06/67] hexagon: remove unused flush_write_buffers definition

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/hexagon/include/asm/io.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h index 66f5e9a61efc..9e8621d94ee9 100644 --- a/arch/hexagon/include/asm/io.h +++ b/arch/h

[PATCH 07/67] m32r: remove unused flush_write_buffers definition

2017-12-29 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/m32r/include/asm/io.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/m32r/include/asm/io.h b/arch/m32r/include/asm/io.h index 1b653bb16f9a..a4272d8f0d9c 100644 --- a/arch/m32r/include/asm/io.h +++ b/arch/m32r/include/as

[PATCH 25/67] dma-direct: rename dma_noop to dma_direct

2017-12-29 Thread Christoph Hellwig
-by: Christoph Hellwig <h...@lst.de> --- MAINTAINERS| 2 +- arch/arm/Kconfig | 2 +- arch/arm/include/asm/dma-mapping.h | 2 +- arch/arm/mm/dma-mapping-nommu.c| 8 arch/m32r/Kconfig | 2 +- arch/riscv/K

[PATCH 21/67] dma-mapping: warn when there is no coherent_dma_mask

2017-12-29 Thread Christoph Hellwig
These days all devices should have a DMA coherent mask, and most dma_ops implementations rely on that fact. But just to be sure add an assert to ring the warning bell if that is not the case. Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/linux/dma-mapping.h | 1 + 1 file chan

[PATCH 23/67] dma-mapping: add an arch_dma_supported hook

2017-12-29 Thread Christoph Hellwig
To implement the x86 forbid_dac and iommu_sac_force we want an arch hook so that it can apply the global options across all dma_map_ops implementations. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/include/asm/dma-mapping.h | 3 +++ arch/x86/kernel/pci-dma.c

[PATCH 20/67] s390: move s390_pci_dma_ops to asm/pci_dma.h

2017-12-29 Thread Christoph Hellwig
This is not needed in drivers, so move it to a private header. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/s390/include/asm/dma-mapping.h | 2 -- arch/s390/include/asm/pci_dma.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/s390/include/a

[PATCH 26/67] dma-direct: use phys_to_dma

2017-12-29 Thread Christoph Hellwig
This means it uses whatever linear remapping scheme that the architecture provides is used in the generic dma_direct ops. Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/dma-direct.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/dma-dire

[PATCH 22/67] dma-mapping: clear harmful GFP_* flags in common code

2017-12-29 Thread Christoph Hellwig
Life the code from x86 so that we behave consistently. In the future we should probably warn if any of these is set. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/cris/arch-v32/drivers/pci/dma.c | 3 --- arch/h8300/kernel/dma.c | 3 --- arch/m68k/kernel

Re: [PATCH 02/67] alpha: mark jensen as broken

2018-01-04 Thread Christoph Hellwig
On Tue, Jan 02, 2018 at 11:36:00AM +0100, Geert Uytterhoeven wrote: > Hi Christoph, > > On Fri, Dec 29, 2017 at 9:18 AM, Christoph Hellwig <h...@lst.de> wrote: > > CONFIG_ALPHA_JENSEN has failed to compile since commit aca05038 > > ("alpha/dma: use common noop

Re: [PATCH 27/67] dma-direct: add dma address sanity checks

2018-01-04 Thread Christoph Hellwig
On Fri, Dec 29, 2017 at 03:12:25PM +0100, Geert Uytterhoeven wrote: > > +check_addr(struct device *dev, dma_addr_t dma_addr, size_t size, > > + const char *caller) > > +{ > > + if (unlikely(dev && !dma_capable(dev, dma_addr, size))) { > > + if (*dev->dma_mask >=

convert parisc to the generic dma-noncoherent code

2018-06-19 Thread Christoph Hellwig
This should address all the comments raised last time. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

[PATCH 2/3] parisc: always use flush_kernel_dcache_range for DMA cache maintainance

2018-06-19 Thread Christoph Hellwig
conservation version for now, but if people more familiar with parisc think the vmap version is generally fine for DMA we should switch all interfaces over to it. Signed-off-by: Christoph Hellwig --- arch/parisc/kernel/pci-dma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH 3/3] parisc: use generic dma_noncoherent_ops

2018-06-19 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Fix sync_single_for_cpu to do skip the cache flush unless the transfer is to the device to match the more tested unmap_single path which should have the same cache coherency implications. Signed-off-by: Christoph Hellwig --- arch

[PATCH 1/3] parisc: merge pcx_dma_ops and pcxl_dma_ops

2018-06-19 Thread Christoph Hellwig
-off-by: Christoph Hellwig --- arch/parisc/include/asm/dma-mapping.h | 3 +- arch/parisc/kernel/pci-dma.c | 80 --- arch/parisc/kernel/setup.c| 8 +-- arch/parisc/mm/init.c | 11 +--- 4 files changed, 43 insertions(+), 59 deletions

[GIT PULL] dma-mapping file renames for Linux 4.18

2018-06-18 Thread Christoph Hellwig
to cf65a0f6f6ff7631ba0ac0513a14ca5b65320d80: dma-mapping: move all DMA mapping code to kernel/dma (2018-06-14 08:50:37 +0200) Christoph Hellwig (2): dma-mapping: use obj-y instead of lib-y for generic dma ops dma-mapping: move all DMA

[PATCH] xtensa: use generic dma_noncoherent_ops

2018-06-19 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig --- arch/xtensa/Kconfig | 3 + arch/xtensa/include/asm/Kbuild| 1 + arch/xtensa/include/asm/dma-mapping.h | 26 -- arch/xtensa/kernel/pci-dma.c | 130

[PATCH] nios2: use generic dma_noncoherent_ops

2018-06-19 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig --- arch/nios2/Kconfig | 3 + arch/nios2/include/asm/Kbuild| 1 + arch/nios2/include/asm/dma-mapping.h | 20 arch/nios2/mm/dma-mapping.c | 139

[PATCH 1/9] ia64: remove the kern_mem_attribute export

2018-08-01 Thread Christoph Hellwig
No actually used anywhere. Signed-off-by: Christoph Hellwig --- arch/ia64/kernel/efi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 9c09bf390cce..f77d80edddfe 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -842,7

DMA related cleanups for IA64

2018-08-01 Thread Christoph Hellwig
Hi all, this is a resend of the last two series plus additional cleanups. The driver of it were the odd dma barriers in the ia64 sync_single_* methods, but once I started to look into that area the fallback got bigger and bigger.. ___ iommu mailing

[PATCH 7/9] ia64/sn2: remove no-ops dma sync methods

2018-08-01 Thread Christoph Hellwig
These do nothing but duplicating an assert that would have triggered earlier on setting the dma mask, so remove them. Signed-off-by: Christoph Hellwig --- arch/ia64/sn/pci/pci_dma.c | 29 - 1 file changed, 29 deletions(-) diff --git a/arch/ia64/sn/pci/pci_dma.c b

[PATCH 2/9] ia64: remove the dead iommu_sac_force variable

2018-08-01 Thread Christoph Hellwig
Looks like copy and paste from x86 that never actually got used. Signed-off-by: Christoph Hellwig --- arch/ia64/kernel/pci-dma.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c index b5df084c0af4..50b6ad282a90

[PATCH 8/9] ia64: remove machvec_dma_sync_{single,sg}

2018-08-01 Thread Christoph Hellwig
semantics and actually are commonly used. The conclusion of this is that they were added in error and should be removed. Signed-off-by: Christoph Hellwig --- arch/ia64/hp/common/sba_iommu.c | 4 arch/ia64/include/asm/dma-mapping.h | 5 - arch/ia64/kernel/machvec.c

[PATCH 3/9] ia64: remove iommu_dma_supported

2018-08-01 Thread Christoph Hellwig
The generic dma_direct_supported helper already used by intel-iommu on x86 does a better job than the ia64 reimplementation. Signed-off-by: Christoph Hellwig --- arch/ia64/kernel/pci-dma.c | 13 - drivers/iommu/intel-iommu.c | 2 -- 2 files changed, 15 deletions(-) diff --git

[PATCH 4/9] ia64: remove the unused bad_dma_address symbol

2018-08-01 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/ia64/kernel/pci-dma.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c index 3c2884bef3d4..924966e5aa25 100644 --- a/arch/ia64/kernel/pci-dma.c +++ b/arch/ia64/kernel/pci-dma.c @@ -15,9 +15,6

[PATCH 6/9] ia64: remove the unused iommu_dma_init function

2018-08-01 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/ia64/include/asm/iommu.h | 1 - arch/ia64/kernel/pci-dma.c| 6 -- 2 files changed, 7 deletions(-) diff --git a/arch/ia64/include/asm/iommu.h b/arch/ia64/include/asm/iommu.h index 5397e5aa3704..7429a72f3f92 100644 --- a/arch/ia64/include/asm

[PATCH 9/9] intel-iommu: mark intel_dma_ops static

2018-08-01 Thread Christoph Hellwig
ia64 currently explicitly assigns it to dma_ops, but that same work is already done by intel_iommu_init a little later, so we can remove the duplicate assignment and mark the variable static. Signed-off-by: Christoph Hellwig --- arch/ia64/kernel/pci-dma.c | 4 drivers/iommu/intel-iommu.c

Re: [PATCH v3] sparc: use generic dma_noncoherent_ops

2018-08-03 Thread Christoph Hellwig
Dave, any chance you would consider reviewing and applying this patch, which already has an ACK from Sam? It would really help me with some core DMA API projects planned for the next merge window. On Tue, Jul 31, 2018 at 10:02:04AM +0200, Christoph Hellwig wrote: > Switch to the gene

use generic DMA mapping code in powerpc

2018-07-30 Thread Christoph Hellwig
Hi all, this series switches the powerpc port to use the generic swiotlb and noncoherent dma ops, and to use more generic code for the coherent direct mapping, as well as removing dead code. ___ iommu mailing list iommu@lists.linux-foundation.org

[PATCH 12/20] powerpc/dma: use phys_to_dma instead of get_dma_offset

2018-07-30 Thread Christoph Hellwig
Use the standard portable helper instead of the powerpc specific one, which is about to go away. Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/dma-swiotlb.c | 5 ++--- arch/powerpc/kernel/dma.c | 12 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git

[PATCH 06/20] dma-noncoherent: add an optional arch hook for ->get_required_mask

2018-07-30 Thread Christoph Hellwig
This is need for powerpc for now. Hopefully we can come up with a clean generic implementation mid-term. Signed-off-by: Christoph Hellwig --- include/linux/dma-noncoherent.h | 6 ++ kernel/dma/Kconfig | 4 kernel/dma/noncoherent.c| 1 + 3 files changed, 11

[PATCH 05/20] swiotlb: allow the architecture to provide a get_required_mask hook

2018-07-30 Thread Christoph Hellwig
For now this allows consolidating the powerpc code. In the long run we should grow a generic implementation of dma_get_required_mask that returns the dma mask required to avoid bounce buffering. Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 4 1 file changed, 4 insertions

[PATCH 19/20] powerpc/dma: use the generic dma-direct map_page and map_sg routines

2018-07-30 Thread Christoph Hellwig
These are indentical except for additional error checking, so migrate to the common code, and wire up the get_mapping_error method as well. Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/dma.c | 32 1 file changed, 4 insertions(+), 28 deletions

[PATCH 18/20] powerpc/dma-noncoherent: use generic dma_noncoherent_ops

2018-07-30 Thread Christoph Hellwig
will lead to more flushing than the previous implementation. Someone more familar with the required CPUs should eventually take a look and optimize the cache flush handling if needed. Signed-off-by: Christoph Hellwig --- arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm

[PATCH 20/20] powerpc/dma: remove dma_nommu_mmap_coherent

2018-07-30 Thread Christoph Hellwig
The remaining implementation for coherent caches is functionally identical to the default provided in common code. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 7 --- arch/powerpc/kernel/dma-iommu.c| 1 - arch/powerpc/kernel/dma.c | 13

[PATCH 02/20] kernel/dma/direct: refine dma_direct_alloc zone selection

2018-07-30 Thread Christoph Hellwig
We need to take the DMA offset and encryption bit into account when selecting a zone. Add a helper that takes those into account and use it. Signed-off-by: Christoph Hellwig --- kernel/dma/direct.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/kernel/dma

[PATCH 15/20] powerpc/dma: remove the unused unmap_page and unmap_sg methods

2018-07-30 Thread Christoph Hellwig
These methods are optional to start with, no need to implement no-op versions. Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/dma.c | 16 1 file changed, 16 deletions(-) diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index 511a4972560d

[PATCH 17/20] powerpc/dma-swiotlb: use generic swiotlb_dma_ops

2018-07-30 Thread Christoph Hellwig
These are identical to the arch specific ones, so remove them. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-direct.h | 4 arch/powerpc/include/asm/swiotlb.h| 2 -- arch/powerpc/kernel/dma-swiotlb.c | 28 ++- arch/powerpc/sysdev

[PATCH] sparc: use generic dma_noncoherent_ops

2018-07-30 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. This removes the previous sync_single_for_device implementation, which looks bogus given that no syncing is happening in the similar but more important map_single case. Signed-off-by: Christoph Hellwig Acked-by: Sam Ravnborg

[PATCH 07/20] powerpc/dma: remove the unused ARCH_HAS_DMA_MMAP_COHERENT define

2018-07-30 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 8fa394520af6..f2a4a7142b1e 100644 --- a/arch/powerpc/include/asm/dma-mapping.h

[PATCH 10/20] powerpc/dma-noncoherent: don't disable irqs over kmap_atomic

2018-07-30 Thread Christoph Hellwig
The requirement to disable local irqs over kmap_atomic is long gone, so remove those calls. Signed-off-by: Christoph Hellwig --- arch/powerpc/mm/dma-noncoherent.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/powerpc/mm/dma-noncoherent.c b/arch/powerpc/mm/dma

[PATCH 08/20] powerpc/dma: remove the unused dma_nommu_ops export

2018-07-30 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/dma.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index dbfc7056d7df..3939589aab04 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arch/powerpc/kernel/dma.c @@ -286,7 +286,6

[PATCH 13/20] powerpc/dma: remove get_dma_offset

2018-07-30 Thread Christoph Hellwig
Just fold the calculation into __phys_to_dma/__dma_to_phys as those are the only places that should know about it. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-direct.h | 8 ++-- arch/powerpc/include/asm/dma-mapping.h | 16 2 files changed, 6

[PATCH 14/20] powerpc/dma: replace dma_nommu_dma_supported with dma_direct_supported

2018-07-30 Thread Christoph Hellwig
The ppc32 case of dma_nommu_dma_supported already was a no-op, and the 64-bit case came to the same conclusion as dma_direct_supported, so replace it with the generic version. Signed-off-by: Christoph Hellwig --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/dma.c | 28

[PATCH 01/20] kernel/dma/direct: take DMA offset into account in dma_direct_supported

2018-07-30 Thread Christoph Hellwig
When a device has a DMA offset the dma capable result will change due to the difference between the physical and DMA address. Take that into account. Signed-off-by: Christoph Hellwig --- kernel/dma/direct.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/dma

[PATCH 03/20] dma-mapping: make the get_required_mask method available unconditionally

2018-07-30 Thread Christoph Hellwig
This save some duplication for ia64. In the long run this method will need some additional work including moving over to kernel/dma, but that will require some additional prep work, so let's do this minimal change for now. Signed-off-by: Christoph Hellwig --- drivers/base/platform.c | 11

<    1   2   3   4   5   6   7   8   9   10   >