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
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.
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
>
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
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
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
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
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
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
__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
* 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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/
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
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.
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
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
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?
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
> &
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
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
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
> >
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
FYI, I've picked this up for dma-mapping for-next now.
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
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
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
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
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
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
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.
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.
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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:
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
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
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
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
.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 - 100 of 368 matches
Mail list logo