Re: [RFC PATCH 1/4] mm: pagewalk: add the ability to install PTEs

2024-10-14 Thread Christoph Hellwig
Hi Lorenzo, sorry for only replying to this so late. On Fri, Sep 27, 2024 at 01:51:11PM +0100, Lorenzo Stoakes wrote: > The existing generic pagewalk logic permits the walking of page tables, > invoking callbacks at individual page table levels via user-provided > mm_walk_ops callbacks. > > This

Re: clearly mark DMA_OPS support as an architecture feature v2

2024-09-03 Thread Christoph Hellwig
I've pulled this into the dma-mapping for-next tree, although I'd love to see one of the vdpa maintainers look over patch 1. I'm pretty sure it's correct, but a confirmation would be good.

Re: [PATCH 2/2] dma-mapping: clearly mark DMA ops as an architecture feature

2024-08-28 Thread Christoph Hellwig
On Wed, Aug 28, 2024 at 08:21:14AM +0200, Andreas Larsson wrote: > On 2024-08-28 08:10, Christoph Hellwig wrote: > > --- a/drivers/xen/Kconfig > > +++ b/drivers/xen/Kconfig > > @@ -177,8 +177,8 @@ config XEN_GRANT_DMA_ALLOC > > > > config SWIOTLB_XEN >

[PATCH 2/2] dma-mapping: clearly mark DMA ops as an architecture feature

2024-08-27 Thread Christoph Hellwig
should probably be marked broken, but we can give them a bit of a grace period for that. Signed-off-by: Christoph Hellwig Reviewed-by: Thomas Gleixner Acked-by: Sakari Ailus # for IPU6 Acked-by: Robin Murphy --- arch/Kconfig | 9 + arch/alpha/Kconfig

[PATCH 1/2] vdpa_sim: don't select DMA_OPS

2024-08-27 Thread Christoph Hellwig
vdpa_sim has been fixed to not override the dma_map_ops in commit 6c3d329e6486 ("vdpa_sim: get rid of DMA ops"), so don't select the symbol and don't depend on HAS_DMA. Signed-off-by: Christoph Hellwig --- drivers/vdpa/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 dele

clearly mark DMA_OPS support as an architecture feature v2

2024-08-27 Thread Christoph Hellwig
Hi all, we've had a long standing problems where drivers try to hook into the DMA_OPS mechanisms to override them for something that is not DMA, or to introduce additional dispatching. Now that we are not using DMA_OPS support for dma-iommu and can build kernels without DMA_OPS support on many co

Re: clearly mark DMA_OPS support as an architecture feasture

2024-08-25 Thread Christoph Hellwig
On Mon, Aug 26, 2024 at 02:27:27PM +0800, Jason Wang wrote: > Actually I meant, we can extend the virtio_config_ops to allow mapping > ops there, then simulator and VDUSE can hook the map ops there. >From a quick glance that feels like the right layer of abstraction, although the config part of th

[PATCH] dma-mapping: clear mark DMA ops as an architecture feature

2024-08-23 Thread Christoph Hellwig
broken, but we can give them a bit of a grace period for that. Signed-off-by: Christoph Hellwig --- arch/Kconfig | 9 + arch/alpha/Kconfig | 2 +- arch/arm/Kconfig | 2 +- arch/arm64/Kconfig | 1 + arch

clearly mark DMA_OPS support as an architecture feasture

2024-08-23 Thread Christoph Hellwig
Hi all, we've had a long standing problems where drivers try to hook into the DMA_OPS mechanisms to override them for something that is not DMA, or to introduce additional dispatching. Now that we are not using DMA_OPS support for dma-iommu and can build kernels without DMA_OPS support on many co

[PATCH 07/21] parisc: remove __ioremap

2019-10-17 Thread Christoph Hellwig
__ioremap is always called with the _PAGE_NO_CACHE, so fold the whole thing and rename it to ioremap. This allows allows to remove the special EISA quirk to force _PAGE_NO_CACHE. Signed-off-by: Christoph Hellwig --- arch/parisc/include/asm/io.h | 11 +-- arch/parisc/mm/ioremap.c

[PATCH 12/21] arch: rely on asm-generic/io.h for default ioremap_* definitions

2019-10-17 Thread Christoph Hellwig
* defintions needs to be changed to purely cpp macros instea of inlines to cover for architectures like openrisc that only define ioremap after including . Signed-off-by: Christoph Hellwig --- arch/arc/include/asm/io.h| 4 arch/arm/include/asm/io.h| 1 - arch/arm64/include/asm

[PATCH 17/21] lib: provide a simple generic ioremap implementation

2019-10-17 Thread Christoph Hellwig
A lot of architectures reuse the same simple ioremap implementation, so start lifting the most simple variant to lib/ioremap.c. It provides ioremap_prot and iounmap, plus a default ioremap that uses prot_noncached, although that can be overridden by asm/io.h. Signed-off-by: Christoph Hellwig

[PATCH 15/21] nios2: remove __iounmap

2019-10-17 Thread Christoph Hellwig
No need to indirect iounmap for nios2. Signed-off-by: Christoph Hellwig --- arch/nios2/include/asm/io.h | 7 +-- arch/nios2/mm/ioremap.c | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h index

[PATCH 13/21] m68k: rename __iounmap and mark it static

2019-10-17 Thread Christoph Hellwig
m68k uses __iounmap as the name for an internal helper that is only used for some CPU types. Mark it static and give it a better name. Signed-off-by: Christoph Hellwig --- arch/m68k/include/asm/kmap.h | 1 - arch/m68k/mm/kmap.c | 9 ++--- 2 files changed, 6 insertions(+), 4

[PATCH 14/21] hexagon: remove __iounmap

2019-10-17 Thread Christoph Hellwig
No need to indirect iounmap for hexagon. Signed-off-by: Christoph Hellwig --- arch/hexagon/include/asm/io.h | 7 +-- arch/hexagon/kernel/hexagon_ksyms.c | 2 +- arch/hexagon/mm/ioremap.c | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/hexagon

[PATCH 11/21] asm-generic: don't provide ioremap for CONFIG_MMU

2019-10-17 Thread Christoph Hellwig
kerneldoc comments in asm-generic/io.h to explain the situation around the default ioremap* implementations correctly. Signed-off-by: Christoph Hellwig --- arch/nds32/include/asm/io.h| 2 ++ arch/sparc/include/asm/io_32.h | 1 + include/asm-generic/io.h | 29

[PATCH 18/21] riscv: use the generic ioremap code

2019-10-17 Thread Christoph Hellwig
Use the generic ioremap code instead of providing a local version. Note that this relies on the asm-generic no-op definition of pgprot_noncached. Signed-off-by: Christoph Hellwig --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/io.h | 3 -- arch/riscv/include/asm

[PATCH 16/21] sh: remove __iounmap

2019-10-17 Thread Christoph Hellwig
No need to indirect iounmap for sh. Signed-off-by: Christoph Hellwig --- arch/sh/include/asm/io.h | 9 ++--- arch/sh/mm/ioremap.c | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index ac0561960c52..1495489225ac

[PATCH 21/21] csky: use generic ioremap

2019-10-17 Thread Christoph Hellwig
Use the generic ioremap_prot and iounmap helpers. Signed-off-by: Christoph Hellwig --- arch/csky/Kconfig | 1 + arch/csky/include/asm/io.h | 8 +++--- arch/csky/include/asm/pgtable.h | 4 +++ arch/csky/mm/ioremap.c | 45 - 4 files

[PATCH 20/21] csky: remove ioremap_cache

2019-10-17 Thread Christoph Hellwig
No driver that can be used on csky uses ioremap_cache, and this interface has been deprecated in favor of memremap. Signed-off-by: Christoph Hellwig --- arch/csky/include/asm/io.h | 2 -- arch/csky/mm/ioremap.c | 7 --- 2 files changed, 9 deletions(-) diff --git a/arch/csky/include/asm

[PATCH 19/21] nds32: use generic ioremap

2019-10-17 Thread Christoph Hellwig
Use the generic ioremap_prot and iounmap helpers. Note that the io.h include in pgtable.h had to be removed to not create an include loop. As far as I can tell there was no need for it to start with. Signed-off-by: Christoph Hellwig --- arch/nds32/Kconfig | 1 + arch/nds32

[PATCH 04/21] hexagon: clean up ioremap

2019-10-17 Thread Christoph Hellwig
Use ioremap as the main implemented function, and defined ioremap_nocache to it as a deprecated alias. Signed-off-by: Christoph Hellwig --- arch/hexagon/include/asm/io.h | 11 ++- arch/hexagon/kernel/hexagon_ksyms.c | 2 +- arch/hexagon/mm/ioremap.c | 2 +- 3 files

[PATCH 03/21] ia64: rename ioremap_nocache to ioremap_uc

2019-10-17 Thread Christoph Hellwig
ments ioremap_uc with a in a similar way as the ia64 version of ioremap_nocache, so implement that instead. Signed-off-by: Christoph Hellwig --- arch/ia64/include/asm/io.h | 6 +++--- arch/ia64/mm/ioremap.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/ia64/in

[PATCH 05/21] alpha: remove the unused __ioremap wrapper

2019-10-17 Thread Christoph Hellwig
No need for the additional namespace pollution. Signed-off-by: Christoph Hellwig --- arch/alpha/include/asm/io.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index af2c0063dc75..1989b946a28d 100644 --- a/arch/alpha/include

[PATCH 08/21] x86: clean up ioremap

2019-10-17 Thread Christoph Hellwig
Use ioremap as the main implemented function, and defined ioremap_nocache to it as a deprecated alias. Signed-off-by: Christoph Hellwig --- arch/x86/include/asm/io.h | 8 ++-- arch/x86/mm/ioremap.c | 8 arch/x86/mm/pageattr.c| 4 ++-- 3 files changed, 8 insertions(+), 12

[PATCH 09/21] xtensa: clean up ioremap

2019-10-17 Thread Christoph Hellwig
Use ioremap as the main implemented function, and defined ioremap_nocache to it as a deprecated alias. Signed-off-by: Christoph Hellwig --- arch/xtensa/include/asm/io.h | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/xtensa/include/asm/io.h b/arch/xtensa

[PATCH 10/21] asm-generic: ioremap_uc should behave the same with and without MMU

2019-10-17 Thread Christoph Hellwig
uses ioremap_uc is atyfb which probably doesn't show up on nommu devices. Signed-off-by: Christoph Hellwig --- include/asm-generic/io.h | 36 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/include/asm-generic/io.h b/include/asm-generic/

[PATCH 06/21] nios2: remove __ioremap

2019-10-17 Thread Christoph Hellwig
The cacheflag argument to __ioremap is always 0, so just implement ioremap directly. Signed-off-by: Christoph Hellwig --- arch/nios2/include/asm/io.h | 20 arch/nios2/mm/ioremap.c | 17 +++-- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a

generic ioremap (and lots of cleanups) v2

2019-10-17 Thread Christoph Hellwig
Hi all, the last patches in this series add a generic ioremap implementation, and switch our 3 most recent and thus most tidy architeture ports over to use it. With a little work and an additional arch hook or two the implementation should be able to eventually cover more than half of our ports.

[PATCH 01/21] arm: remove ioremap_cached

2019-10-17 Thread Christoph Hellwig
No users of ioremap_cached are left, remove it. Signed-off-by: Christoph Hellwig --- arch/arm/include/asm/io.h | 6 -- arch/arm/mm/ioremap.c | 4 arch/arm/mm/mmu.c | 2 +- arch/arm/mm/nommu.c | 4 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a

[PATCH 02/21] unicore32: remove ioremap_cached

2019-10-17 Thread Christoph Hellwig
No users of ioremap_cached are left, remove it. Signed-off-by: Christoph Hellwig --- arch/unicore32/include/asm/io.h | 4 +--- arch/unicore32/mm/ioremap.c | 8 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/unicore32/include/asm/io.h b/arch/unicore32/include

Re: [PATCH 24/26] riscv: use the generic ioremap code

2019-09-01 Thread Christoph Hellwig
On Sat, Aug 17, 2019 at 02:22:15PM -0700, Paul Walmsley wrote: > Reviewed-by: Paul Walmsley > Tested-by: Paul Walmsley # rv32, rv64 boot > Acked-by: Paul Walmsley # arch/riscv Can you also take a look at the patch adding the generic code?

Re: [PATCH 05/26] openrisc: map as uncached in ioremap

2019-08-30 Thread Christoph Hellwig
On Fri, Aug 23, 2019 at 10:55:39PM +0900, Stafford Horne wrote: > On Sat, Aug 17, 2019 at 09:32:32AM +0200, Christoph Hellwig wrote: > > Openrisc is the only architecture not mapping ioremap as uncached, > > which has been the default since the Linux 2.6.x days. Switch it > &

Re: [PATCH 04/26] mips: remove ioremap_cachable

2019-08-30 Thread Christoph Hellwig
On Mon, Aug 19, 2019 at 08:57:30PM +, Paul Burton wrote: > Hi Christoph, > > On Sat, Aug 17, 2019 at 09:32:31AM +0200, Christoph Hellwig wrote: > > Just define ioremap_cache directly. > > > > Signed-off-by: Christoph Hellwig > > Acked-by: Paul Burton C

Re: [PATCH 08/26] m68k: simplify ioremap_nocache

2019-08-30 Thread Christoph Hellwig
On Mon, Aug 19, 2019 at 10:56:02AM +0200, Geert Uytterhoeven wrote: > Hi Christoph, > > On Sat, Aug 17, 2019 at 9:48 AM Christoph Hellwig wrote: > > Just define ioremap_nocache to ioremap instead of duplicating the > > inline. Also defined ioremap_uc in terms of ioremap ins

Re: [PATCH 12/26] x86: clean up ioremap

2019-08-30 Thread Christoph Hellwig
On Sat, Aug 17, 2019 at 12:34:02PM +0200, Ingo Molnar wrote: > > * Christoph Hellwig wrote: > > > Use ioremap as the main implemented function, and defined > > ioremap_nocache to it as a deprecated alias. > > > > Signed-off-by: Christoph Hellwig > >

Re: [PATCH 19/26] arm64: remove __iounmap

2019-08-30 Thread Christoph Hellwig
On Mon, Aug 19, 2019 at 08:36:02AM +0100, Will Deacon wrote: > On Sat, Aug 17, 2019 at 09:32:46AM +0200, Christoph Hellwig wrote: > > No need to indirect iounmap for arm64. > > > > Signed-off-by: Christoph Hellwig > > --- > > arch/arm64/include/asm/io.h | 3

Re: ensure dma_alloc_coherent always returns zeroed memory

2018-12-19 Thread Christoph Hellwig
FYI, I've picked this up for dma-mapping for-next now.

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-17 Thread Christoph Hellwig
On Sat, Dec 15, 2018 at 12:14:29AM +1000, Greg Ungerer wrote: > Yep, that is right. Certainly the MMU case is broken. Some noMMU cases work > by virtue of the SoC only having an instruction cache (the older V2 cores). Is there a good an easy case to detect if a core has a cache? Either runtime or

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Christoph Hellwig
On Fri, Dec 14, 2018 at 07:10:56PM +0100, Sam Ravnborg wrote: > Hi Christoph, > > I stumbled upon this one: > > #define __get_dma_pages(gfp_mask, order) \ > __get_free_pages((gfp_mask) | GFP_DMA, (order)) This isn't directly related to the dma mapping, but another place that hide

Re: ensure dma_alloc_coherent always returns zeroed memory

2018-12-14 Thread Christoph Hellwig
And in various places this used GFP_ZERO instead of __GFP_ZERO, so won't compile. The fixed version is available here: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-alloc-always-zero

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Christoph Hellwig
the generic remapping helpers that have been added for the 4.21 merge window: http://git.infradead.org/users/hch/dma-mapping.git/commitdiff/0c3b3171ceccb8830c2bb5adff1b4e9b204c1450 Compile tested only patch below: -- >From ade86dc75b9850daf9111ebf9ce15825a6144f2d Mon Sep 17 00:00:0

[PATCH 2/2] dma-mapping: deprecate dma_zalloc_coherent

2018-12-14 Thread Christoph Hellwig
We now always return zeroed memory from dma_alloc_coherent. Note that simply passing GFP_ZERO to dma_alloc_coherent wasn't always doing the right thing to start with given that various allocators are not backed by the page allocator and thus would ignore GFP_ZERO. Signed-off-by: Chri

[PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Christoph Hellwig
cator or doing a manual memset otherwise. Signed-off-by: Christoph Hellwig --- arch/alpha/kernel/pci_iommu.c| 2 +- arch/arc/mm/dma.c| 2 +- arch/c6x/mm/dma-coherent.c | 5 - arch/m68k/kernel/dma.c | 2 +- arch/microblaze/mm/consistent.c | 2 +- arch/ope

ensure dma_alloc_coherent always returns zeroed memory

2018-12-14 Thread Christoph Hellwig
For security reasons we already returned zeroed memory from dma_alloc_coherent on most common platforms, but some implementation missed out. Make sure we provide a consistent behavior.

Re: remove the ->mapping_error method from dma_map_ops V3

2018-12-06 Thread Christoph Hellwig
I've pulled this into the dma-mapping for-next tree, with the suggestion from Robin that improves bisectability, and two unused variables found by the build bot.

Re: [PATCH 01/23] dma-mapping: provide a generic DMA_MAPPING_ERROR

2018-12-04 Thread Christoph Hellwig
On Tue, Dec 04, 2018 at 04:41:34PM +, Robin Murphy wrote: > I'd have been inclined to put the default check here, i.e. > > - return 0 > + return dma_addr == DMA_MAPPING_ERROR > > such that the callback retains full precedence and we don't have to deal > with the non-trivial removals im

Re: remove the ->mapping_error method from dma_map_ops V3

2018-12-03 Thread Christoph Hellwig
Does anyone but Linus and Russell have comments on this series? I'd like to pull it in fairly quickly as I have a fair amount of work on top of it that I'd like to get into 4.21 as well.

[PATCH 12/23] ia64/sba_iommu: improve internal map_page users

2018-11-30 Thread Christoph Hellwig
Remove the odd sba_{un,}map_single_attrs wrappers, check errors everywhere. Signed-off-by: Christoph Hellwig --- arch/ia64/hp/common/sba_iommu.c | 73 + 1 file changed, 29 insertions(+), 44 deletions(-) diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp

[PATCH 01/23] dma-mapping: provide a generic DMA_MAPPING_ERROR

2018-11-30 Thread Christoph Hellwig
m the dma_map* routines this values means they will generally not be pointed to actual memory. Once the default value is added here we can start removing the various mapping_error methods and just rely on this generic check. Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 6 ++ 1

[PATCH 15/23] x86/amd_gart: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of the magic bad_dma_addr on a dma mapping failure and let the core dma-mapping code handle the rest. Remove the magic EMERGENCY_PAGES that the bad_dma_addr gets redirected to. Signed-off-by: Christoph Hellwig --- arch/x86/kernel/amd_gart_64.c | 39

[PATCH 14/23] ia64/sn: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/ia64/sn/pci/pci_dma.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn

[PATCH 04/23] powerpc/iommu: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
The powerpc iommu code already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/iommu.h | 4 arch/powerpc/kernel/dma

[PATCH 02/23] dma-direct: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
The dma-direct code already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/dma-swiotlb.c | 1 - include/linux/dma-direct.h

[PATCH 13/23] ia64/sba_iommu: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/ia64/hp/common/sba_iommu.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/ia64/hp/common/sba_iommu.c b

[PATCH 11/23] alpha: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/alpha/kernel/pci_iommu.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/alpha/kernel/pci_iommu.c

[PATCH 16/23] x86/calgary: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of the magic bad_dma_addr on a dma mapping failure and let the core dma-mapping code handle the rest. Remove the magic EMERGENCY_PAGES that the bad_dma_addr gets redirected to. Signed-off-by: Christoph Hellwig --- arch/x86/kernel/pci-calgary_64.c | 29

[PATCH 09/23] parisc/sba_iommu: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
The SBA iommu code already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- drivers/parisc/sba_iommu.c | 10 +- 1 file changed, 1 insertion(+), 9

[PATCH 03/23] arm: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
Arm already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/arm/common/dmabounce.c | 12 +++--- arch/arm/include/asm/dma-iommu.h | 2

[PATCH 10/23] arm64: remove the dummy_dma_ops mapping_error method

2018-11-30 Thread Christoph Hellwig
Just return DMA_MAPPING_ERROR from __dummy_map_page and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/arm64/mm/dma-mapping.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma

[PATCH 21/23] xen-swiotlb: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- drivers/xen/swiotlb-xen.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers

[PATCH 22/23] dma-mapping: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
No users left except for vmd which just forwards it. Signed-off-by: Christoph Hellwig --- drivers/pci/controller/vmd.c | 6 -- include/linux/dma-mapping.h | 7 --- 2 files changed, 13 deletions(-) diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index

[PATCH 18/23] iommu/intel: small map_page cleanup

2018-11-30 Thread Christoph Hellwig
Pass the page + offset to the low-level __iommu_map_single helper (which gets renamed to fit the new calling conventions) as both callers have the page at hand. Signed-off-by: Christoph Hellwig --- drivers/iommu/intel-iommu.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions

[PATCH 17/23] iommu: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
users of that interface. Signed-off-by: Christoph Hellwig --- drivers/iommu/amd_iommu.c | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 1167ff0416cf..c5d6c7c42b0a 100644 --- a/drivers/iommu/amd_iommu.c

[PATCH 23/23] dma-mapping: return an error code from dma_mapping_error

2018-11-30 Thread Christoph Hellwig
seems to be what the largest number of callers convert it to, and which also matches the typical error case where we are out of resources. Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/dma

[PATCH 20/23] iommu/dma-iommu: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/arm64/mm/dma-mapping.c | 7 +++ drivers/iommu/dma-iommu.c | 23 --- include/linux/dma-iommu.h | 1 - 3 files

[PATCH 19/23] iommu/vt-d: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- drivers/iommu/intel-iommu.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b

[PATCH 07/23] sparc: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
Sparc already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/sparc/kernel/iommu.c| 12 +++- arch/sparc/kernel/iommu_common.h | 2

[PATCH 05/23] mips/jazz: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
The Jazz iommu code already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/mips/include/asm/jazzdma.h | 6 -- arch/mips/jazz/jazzdma.c

[PATCH 06/23] s390: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
S390 already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/s390/pci/pci_dma.c | 18 +- 1 file changed, 5 insertions(+), 13

[PATCH 08/23] parisc/ccio: remove the mapping_error dma_map_ops method

2018-11-30 Thread Christoph Hellwig
The CCIO iommu code already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- drivers/parisc/ccio-dma.c | 10 +- 1 file changed, 1 insertion(+), 9

remove the ->mapping_error method from dma_map_ops V3

2018-11-30 Thread Christoph Hellwig
Error reporting for the dma_map_single and dma_map_page operations is currently a mess. Both APIs directly return the dma_addr_t to be used for the DMA, with a magic error escape that is specific to the instance and checked by another method provided. This has a few downsides: - the error check

Re: remove the ->mapping_error method from dma_map_ops V2

2018-11-29 Thread Christoph Hellwig
On Thu, Nov 29, 2018 at 10:53:32AM -0800, Linus Torvalds wrote: > Most of the high-performance IO is already using SG lists anyway, no? > Disk/networking/whatever. Networking basically never uses S/G lists. Block I/O mostly uses it, and graphics / media seems to have a fair amount of S/G uses, in

Re: remove the ->mapping_error method from dma_map_ops V2

2018-11-29 Thread Christoph Hellwig
On Thu, Nov 29, 2018 at 09:44:05AM -0800, Linus Torvalds wrote: > No. Really. If there's no iotlb, then you just mark that one page > reserved. It simply doesn't get used. It doesn't mean you suddenly > need a swiotlb. Sure, we could just skip that page entirely based on dma_to_phys. > But whatev

Re: remove the ->mapping_error method from dma_map_ops V2

2018-11-29 Thread Christoph Hellwig
On Wed, Nov 28, 2018 at 11:19:15AM -0800, Linus Torvalds wrote: > Let me just paste it back in here: > > "Which is what we ALREADY do for these exact reasons. If the DMA > mappings means that you'd need to add one more page to that list of > reserved pages, then so be it." > > So no, I'm not at

Re: remove the ->mapping_error method from dma_map_ops V2

2018-11-27 Thread Christoph Hellwig
On Fri, Nov 23, 2018 at 07:55:11AM +0100, Christoph Hellwig wrote: > On Thu, Nov 22, 2018 at 09:55:25AM -0800, Linus Torvalds wrote: > > No, the big immediate benefit of allowing "return -EINVAL" etc is > > simply legibility and error avoidance. > > Well, I can

Re: remove the ->mapping_error method from dma_map_ops V2

2018-11-22 Thread Christoph Hellwig
On Thu, Nov 22, 2018 at 06:05:26PM +, Russell King - ARM Linux wrote: > An alternative idea would be to migrate away from the > dma_map_single() and dma_map_page() interfaces that return a > dma_addr_t, and instead have them return an error code or zero > on success. See here for a proposal:

Re: remove the ->mapping_error method from dma_map_ops V2

2018-11-22 Thread Christoph Hellwig
On Thu, Nov 22, 2018 at 09:55:25AM -0800, Linus Torvalds wrote: > No, the big immediate benefit of allowing "return -EINVAL" etc is > simply legibility and error avoidance. Well, I can tweak the last patch to return -EINVAL from dma_mapping_error instead of the old 1 is as bool true. The callers

remove the ->mapping_error method from dma_map_ops V2

2018-11-22 Thread Christoph Hellwig
Error reporting for the dma_map_single and dma_map_page operations is currently a mess. Both APIs directly return the dma_addr_t to be used for the DMA, with a magic error escape that is specific to the instance and checked by another method provided. This has a few downsides: - the error check

[PATCH 05/24] arm: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
Arm already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/arm/common/dmabounce.c | 12 +++--- arch/arm/include/asm/dma-iommu.h | 2

[PATCH 06/24] powerpc/iommu: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
The powerpc iommu code already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/iommu.h | 4 arch/powerpc/kernel/dma

[PATCH 02/24] swiotlb: Skip cache maintenance on map error

2018-11-22 Thread Christoph Hellwig
. Don't do that. Fixes: a4a4330db46a ("swiotlb: add support for non-coherent DMA") Tested-by: John Stultz Signed-off-by: Robin Murphy Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/dma/swiotlb

[PATCH 09/24] sparc: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
Sparc already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/sparc/kernel/iommu.c| 12 +++- arch/sparc/kernel/iommu_common.h | 2

[PATCH 08/24] s390: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
S390 already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/s390/pci/pci_dma.c | 18 +- 1 file changed, 5 insertions(+), 13

[PATCH 04/24] dma-direct: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
The dma-direct code already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/dma-swiotlb.c | 1 - include/linux/dma-direct.h

[PATCH 07/24] mips/jazz: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
The Jazz iommu code already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/mips/include/asm/jazzdma.h | 6 -- arch/mips/jazz/jazzdma.c

[PATCH 10/24] parisc/ccio: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
The CCIO iommu code already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- drivers/parisc/ccio-dma.c | 10 +- 1 file changed, 1 insertion(+), 9

[PATCH 12/24] arm64: remove the dummy_dma_ops mapping_error method

2018-11-22 Thread Christoph Hellwig
Just return DMA_MAPPING_ERROR from __dummy_map_page and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/arm64/mm/dma-mapping.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma

[PATCH 11/24] parisc/sba_iommu: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
The SBA iommu code already returns (~(dma_addr_t)0x0) on mapping failures, so we can switch over to returning DMA_MAPPING_ERROR and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- drivers/parisc/sba_iommu.c | 10 +- 1 file changed, 1 insertion(+), 9

[PATCH 17/24] x86/amd_gart: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of the magic bad_dma_addr on a dma mapping failure and let the core dma-mapping code handle the rest. Remove the magic EMERGENCY_PAGES that the bad_dma_addr gets redirected to. Signed-off-by: Christoph Hellwig --- arch/x86/kernel/amd_gart_64.c | 39

[PATCH 15/24] ia64/sba_iommu: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/ia64/hp/common/sba_iommu.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/ia64/hp/common/sba_iommu.c b

[PATCH 23/24] xen-swiotlb: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- drivers/xen/swiotlb-xen.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers

[PATCH 16/24] ia64/sn: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/ia64/sn/pci/pci_dma.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn

[PATCH 18/24] x86/calgary: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of the magic bad_dma_addr on a dma mapping failure and let the core dma-mapping code handle the rest. Remove the magic EMERGENCY_PAGES that the bad_dma_addr gets redirected to. Signed-off-by: Christoph Hellwig --- arch/x86/kernel/pci-calgary_64.c | 29

[PATCH 20/24] iommu/intel: small map_page cleanup

2018-11-22 Thread Christoph Hellwig
Pass the page + offset to the low-level __iommu_map_single helper (which gets renamed to fit the new calling conventions) as both callers have the page at hand. Signed-off-by: Christoph Hellwig --- drivers/iommu/intel-iommu.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions

[PATCH 19/24] iommu: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
users of that interface. Signed-off-by: Christoph Hellwig --- drivers/iommu/amd_iommu.c | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 1167ff0416cf..c5d6c7c42b0a 100644 --- a/drivers/iommu/amd_iommu.c

[PATCH 24/24] dma-mapping: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
No users left except for vmd which just forwards it. Also switch dma_mapping_error to an explicit bool return value. Signed-off-by: Christoph Hellwig --- drivers/pci/controller/vmd.c | 6 -- include/linux/dma-mapping.h | 13 ++--- 2 files changed, 2 insertions(+), 17 deletions

[PATCH 22/24] iommu/dma-iommu: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- arch/arm64/mm/dma-mapping.c | 7 +++ drivers/iommu/dma-iommu.c | 23 --- include/linux/dma-iommu.h | 1 - 3 files

[PATCH 21/24] iommu/vt-d: remove the mapping_error dma_map_ops method

2018-11-22 Thread Christoph Hellwig
Return DMA_MAPPING_ERROR instead of 0 on a dma mapping failure and let the core dma-mapping code handle the rest. Signed-off-by: Christoph Hellwig --- drivers/iommu/intel-iommu.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b

[PATCH 14/24] ia64/sba_iommu: improve internal map_page users

2018-11-22 Thread Christoph Hellwig
Remove the odd sba_{un,}map_single_attrs wrappers, check errors everywhere, and remove the completly bogus alloc_pages_node call that uses the dma attributes argument as the node id. Signed-off-by: Christoph Hellwig --- arch/ia64/hp/common/sba_iommu.c | 71 - 1

  1   2   3   4   >