xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Christoph Hellwig <hch@lst.de>,
	x86@kernel.org, linux-arm-kernel@lists.infradead.org,
	xen-devel@lists.xenproject.org, linux-c6x-dev@linux-c6x.org,
	linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org,
	linux-mips@linux-mips.org, openrisc@lists.librecores.org,
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org, sparclinux@vger.kernel.org,
	linux-xtensa@linux-xtensa.org, dmaengine@vger.kernel.org,
	linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-samsung-soc@vger.kernel.org,
	iommu@lists.linux-foundation.org, netdev@vger.kernel.org,
	Alistair Popple <apopple@au1.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 21/44] powerpc: implement ->mapping_error
Date: Wed, 14 Jun 2017 19:17:27 +1000	[thread overview]
Message-ID: <87vanz2ajc.fsf__512.101621325378$1497431903$gmane$org@concordia.ellerman.id.au> (raw)
In-Reply-To: <20170608132609.32662-22-hch@lst.de>

Christoph Hellwig <hch@lst.de> 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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-06-14  9:17 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170608132609.32662-1-hch@lst.de>
2017-06-08 13:25 ` [PATCH 01/44] firmware/ivc: use dma_mapping_error Christoph Hellwig
2017-06-08 13:25 ` [PATCH 02/44] ibmveth: properly unwind on init errors Christoph Hellwig
2017-06-08 13:25 ` [PATCH 03/44] dmaengine: ioat: don't use DMA_ERROR_CODE Christoph Hellwig
2017-06-08 13:25 ` [PATCH 04/44] drm/exynos: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 05/44] drm/armada: don't abuse DMA_ERROR_CODE Christoph Hellwig
2017-06-08 13:25 ` [PATCH 06/44] iommu/dma: don't rely on DMA_ERROR_CODE Christoph Hellwig
2017-06-08 13:25 ` [PATCH 07/44] xen-swiotlb: consolidate xen_swiotlb_dma_ops Christoph Hellwig
2017-06-08 13:25 ` [PATCH 08/44] xen-swiotlb: implement ->mapping_error Christoph Hellwig
2017-06-08 13:25 ` [PATCH 09/44] c6x: remove DMA_ERROR_CODE Christoph Hellwig
2017-06-08 13:25 ` [PATCH 10/44] ia64: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 11/44] m32r: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 12/44] microblaze: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 13/44] openrisc: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 14/44] sh: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 15/44] xtensa: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 16/44] arm64: " Christoph Hellwig
2017-06-08 14:02   ` Robin Murphy
2017-06-08 13:25 ` [PATCH 17/44] hexagon: switch to use ->mapping_error for error reporting Christoph Hellwig
2017-06-08 13:25 ` [PATCH 18/44] iommu/amd: implement ->mapping_error Christoph Hellwig
2017-06-08 13:25 ` [PATCH 19/44] s390: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 20/44] sparc: " Christoph Hellwig
2017-06-08 14:24   ` David Miller
2017-06-08 13:25 ` [PATCH 21/44] powerpc: " Christoph Hellwig
2017-06-14  9:17   ` Michael Ellerman [this message]
2017-06-08 13:25 ` [PATCH 22/44] x86/pci-nommu: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 23/44] x86/calgary: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 24/44] x86: remove DMA_ERROR_CODE Christoph Hellwig
2017-06-08 13:25 ` [PATCH 25/44] arm: implement ->mapping_error Christoph Hellwig
2017-06-08 14:43   ` Russell King - ARM Linux
     [not found]   ` <20170608144313.GL4902@n2100.armlinux.org.uk>
2017-06-16  8:43     ` Christoph Hellwig
2017-06-08 13:25 ` [PATCH 26/44] dma-mapping: remove DMA_ERROR_CODE Christoph Hellwig
2017-06-08 13:25 ` [PATCH 27/44] sparc: remove leon_dma_ops Christoph Hellwig
2017-06-08 13:25 ` [PATCH 28/44] sparc: remove arch specific dma_supported implementations Christoph Hellwig
2017-06-08 13:25 ` [PATCH 29/44] dma-noop: remove dma_supported and mapping_error methods Christoph Hellwig
2017-06-08 13:25 ` [PATCH 30/44] dma-virt: " Christoph Hellwig
2017-06-08 13:25 ` [PATCH 31/44] hexagon: remove arch-specific dma_supported implementation Christoph Hellwig
2017-06-08 13:25 ` [PATCH 32/44] hexagon: remove the unused dma_is_consistent prototype Christoph Hellwig
2017-06-08 13:25 ` [PATCH 33/44] openrisc: remove arch-specific dma_supported implementation Christoph Hellwig
2017-06-09 12:20   ` Geert Uytterhoeven
     [not found]   ` <CAMuHMdUPeFJJtz8eJkQEAR-2w9oHt-fXeGHvvKFLfU2A4YyviQ@mail.gmail.com>
2017-06-16  8:39     ` Christoph Hellwig
2017-06-08 13:25 ` [PATCH 34/44] arm: remove arch specific " Christoph Hellwig
2017-06-08 13:26 ` [PATCH 35/44] x86: " Christoph Hellwig
2017-06-08 13:26 ` [PATCH 36/44] dma-mapping: remove HAVE_ARCH_DMA_SUPPORTED Christoph Hellwig
2017-06-08 13:26 ` [PATCH 37/44] mips/loongson64: implement ->dma_supported instead of ->set_dma_mask Christoph Hellwig
2017-06-08 13:26 ` [PATCH 38/44] arm: " Christoph Hellwig
2017-06-08 13:26 ` [PATCH 39/44] xen-swiotlb: remove xen_swiotlb_set_dma_mask Christoph Hellwig
2017-06-08 13:26 ` [PATCH 40/44] tile: remove dma_supported and mapping_error methods Christoph Hellwig
2017-06-08 13:26 ` [PATCH 41/44] powerpc/cell: clean up fixed mapping dma_ops initialization Christoph Hellwig
2017-06-08 13:26 ` [PATCH 42/44] powerpc/cell: use the dma_supported method for ops switching Christoph Hellwig
2017-06-08 13:26 ` [PATCH 43/44] dma-mapping: remove the set_dma_mask method Christoph Hellwig
2017-06-08 13:26 ` [PATCH 44/44] powerpc: merge __dma_set_mask into dma_set_mask Christoph Hellwig
     [not found] ` <20170608132609.32662-7-hch@lst.de>
2017-06-08 13:59   ` [PATCH 06/44] iommu/dma: don't rely on DMA_ERROR_CODE Robin Murphy
     [not found]   ` <0bfb0841-f054-78de-628d-a0955336bcb4@arm.com>
2017-06-16  8:37     ` Christoph Hellwig
2017-06-08 14:21 ` clean up and modularize arch dma_mapping interface David Miller
     [not found] ` <20170608132609.32662-3-hch@lst.de>
2017-06-08 14:21   ` [PATCH 02/44] ibmveth: properly unwind on init errors David Miller
     [not found] ` <20170608132609.32662-28-hch@lst.de>
2017-06-08 14:22   ` [PATCH 27/44] sparc: remove leon_dma_ops David Miller
2017-06-12  8:06   ` Andreas Larsson
     [not found]   ` <593E4B82.70306@gaisler.com>
2017-06-16  8:45     ` Christoph Hellwig
     [not found] ` <20170608132609.32662-29-hch@lst.de>
2017-06-08 14:22   ` [PATCH 28/44] sparc: remove arch specific dma_supported implementations Julian Calaby
2017-06-08 14:24   ` David Miller
     [not found]   ` <CAGRGNgUJ3J_LEwhJ1rFHuzZ_J4OnTV9-DekcuT=N5z1pBKcb3A@mail.gmail.com>
2017-06-16  8:47     ` Christoph Hellwig
     [not found] ` <20170608132609.32662-20-hch@lst.de>
2017-06-08 16:23   ` [PATCH 19/44] s390: implement ->mapping_error Gerald Schaefer
     [not found] ` <20170608132609.32662-4-hch@lst.de>
2017-06-08 16:32   ` [PATCH 03/44] dmaengine: ioat: don't use DMA_ERROR_CODE Dave Jiang
2017-06-14  8:31   ` Vinod Koul
     [not found] ` <20170608132609.32662-8-hch@lst.de>
2017-06-11  2:36   ` [PATCH 07/44] xen-swiotlb: consolidate xen_swiotlb_dma_ops Konrad Rzeszutek Wilk
     [not found] ` <20170608132609.32662-9-hch@lst.de>
2017-06-11  2:37   ` [PATCH 08/44] xen-swiotlb: implement ->mapping_error Konrad Rzeszutek Wilk
     [not found] ` <20170608132609.32662-2-hch@lst.de>
2017-06-13 12:35   ` [PATCH 01/44] firmware/ivc: use dma_mapping_error Thierry Reding
     [not found] ` <20170608132609.32662-18-hch@lst.de>
2017-06-16  0:19   ` [PATCH 17/44] hexagon: switch to use ->mapping_error for error reporting Richard Kuo
     [not found] ` <20170608132609.32662-32-hch@lst.de>
2017-06-16  0:20   ` [PATCH 31/44] hexagon: remove arch-specific dma_supported implementation Richard Kuo
2017-06-20  9:19 ` clean up and modularize arch dma_mapping interface Daniel Vetter
     [not found] ` <20170620091902.2dldmf43vhazq6yh@phenom.ffwll.local>
2017-06-20 13:17   ` Christoph Hellwig
     [not found] <20170616181059.19206-1-hch@lst.de>
2017-06-16 18:10 ` [PATCH 21/44] powerpc: implement ->mapping_error Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='87vanz2ajc.fsf__512.101621325378$1497431903$gmane$org@concordia.ellerman.id.au' \
    --to=mpe@ellerman.id.au \
    --cc=apopple@au1.ibm.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-c6x-dev@linux-c6x.org \
    --cc=linux-hexagon@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=openrisc@lists.librecores.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).