Thread (72 messages) 72 messages, 15 authors, 2017-06-20

Re: [PATCH 21/44] powerpc: implement ->mapping_error

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-06-14 09:18:09
Also in: dri-devel, linux-arm-kernel, linux-iommu, linux-mips, linux-samsung-soc, linux-sh, linux-tegra, lkml, netdev, sparclinux

Christoph Hellwig [off-list ref] writes:
DMA_ERROR_CODE is going to go away, so don't rely on it.  Instead
define a ->mapping_error method for all IOMMU based dma operation
instances.  The direct ops don't ever return an error and don't
need a ->mapping_error method.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/powerpc/include/asm/dma-mapping.h |  4 ----
 arch/powerpc/include/asm/iommu.h       |  4 ++++
 arch/powerpc/kernel/dma-iommu.c        |  6 ++++++
 arch/powerpc/kernel/iommu.c            | 28 ++++++++++++++--------------
 arch/powerpc/platforms/cell/iommu.c    |  1 +
 arch/powerpc/platforms/pseries/vio.c   |  3 ++-
 6 files changed, 27 insertions(+), 19 deletions(-)
I also see:

  arch/powerpc/kernel/dma.c:const struct dma_map_ops dma_direct_ops = {

Which you mentioned can't fail.

  arch/powerpc/platforms/pseries/ibmebus.c:static const struct dma_map_ops ibmebus_dma_ops = {

Which can't fail.

And:

  arch/powerpc/platforms/powernv/npu-dma.c:static const struct dma_map_ops dma_npu_ops = {
  arch/powerpc/platforms/ps3/system-bus.c:static const struct dma_map_ops ps3_sb_dma_ops = {
  arch/powerpc/platforms/ps3/system-bus.c:static const struct dma_map_ops ps3_ioc0_dma_ops = {

All of which look like they definitely can fail, but return 0 on error
and don't implement ->mapping_error.

So I guess I'm acking this and adding a TODO to fix up the NPU code at
least, the ps3 code is probably better left alone these days.

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help