linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: 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,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 42/44] powerpc/cell: use the dma_supported method for ops switching
Date: Sun, 18 Jun 2017 00:13:44 -0700	[thread overview]
Message-ID: <20170618071344.GB18526@infradead.org> (raw)
In-Reply-To: <1497732627.2897.128.camel@kernel.crashing.org>

On Sun, Jun 18, 2017 at 06:50:27AM +1000, Benjamin Herrenschmidt wrote:
> What is your rationale here ? (I have missed patch 0 it seems).

Less code duplication, more modular dma_map_ops insteance.

> dma_supported() was supposed to be pretty much a "const" function
> simply informing whether a given setup is possible. Having it perform
> an actual switch of ops seems to be pushing it...

dma_supported() is already gone from the public DMA API as it doesn't
make sense to be called separately from set_dma_mask.  It will be
entirely gone in the next series after this one.

> What if a driver wants to test various dma masks and then pick one ?
> 
> Where does the API documents that if a driver calls dma_supported() it
> then *must* set the corresponding mask and use that ?

Where is the API document for _any_ of the dma routines? (A: work in
progress by me, but I need to clean up the mess of arch hooks before
it can make any sense)

> I don't like a function that is a "boolean query" like this one to have
> such a major side effect.
> 
> >From an API standpoint, dma_set_mask() is when the mask is established,
> and thus when the ops switch should happen.

And that's exactly what happens at the driver API level.  It just turns
out the dma_capable method is they way better place to actually
implement it, as the ->set_dma_mask method requires lots of code
duplication while not offering any actual benefit over ->dma_capable.
And because of that it's gone after this series.

In theory we could rename ->dma_capable now, but it would require a
_lot_ of churn.  Give me another merge window or two and we should
be down to be about 2 handful of dma_map_ops instance, at which point
we could do all this gratious renaming a lot more easily :)

  reply	other threads:[~2017-06-18  7:13 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 18:10 clean up and modularize arch dma_mapping interface V2 Christoph Hellwig
2017-06-16 18:10 ` [PATCH 01/44] firmware/ivc: use dma_mapping_error Christoph Hellwig
2017-06-16 18:10 ` [PATCH 02/44] ibmveth: properly unwind on init errors Christoph Hellwig
2017-06-16 18:10 ` [PATCH 03/44] dmaengine: ioat: don't use DMA_ERROR_CODE Christoph Hellwig
2017-06-16 20:40   ` Alexander Duyck
2017-06-18  7:09     ` Christoph Hellwig
2017-06-16 18:10 ` [PATCH 04/44] drm/exynos: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 05/44] drm/armada: don't abuse DMA_ERROR_CODE Christoph Hellwig
2017-06-16 18:10 ` [PATCH 06/44] iommu/dma: don't rely on DMA_ERROR_CODE Christoph Hellwig
2017-06-19 15:12   ` Robin Murphy
2017-06-16 18:10 ` [PATCH 07/44] xen-swiotlb: consolidate xen_swiotlb_dma_ops Christoph Hellwig
2017-06-16 18:10 ` [PATCH 08/44] xen-swiotlb: implement ->mapping_error Christoph Hellwig
2017-06-16 18:10 ` [PATCH 09/44] c6x: remove DMA_ERROR_CODE Christoph Hellwig
2017-06-16 18:10 ` [PATCH 10/44] ia64: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 11/44] m32r: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 12/44] microblaze: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 13/44] openrisc: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 14/44] sh: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 15/44] xtensa: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 16/44] arm64: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 17/44] hexagon: switch to use ->mapping_error for error reporting Christoph Hellwig
2017-06-16 18:10 ` [PATCH 18/44] iommu/amd: implement ->mapping_error Christoph Hellwig
2017-06-16 18:10 ` [PATCH 19/44] s390: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 20/44] sparc: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 21/44] powerpc: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 22/44] x86/pci-nommu: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 23/44] x86/calgary: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 24/44] x86: remove DMA_ERROR_CODE Christoph Hellwig
2017-06-16 18:10 ` [PATCH 25/44] arm: implement ->mapping_error Christoph Hellwig
2017-06-16 18:10 ` [PATCH 26/44] dma-mapping: remove DMA_ERROR_CODE Christoph Hellwig
2017-06-16 18:10 ` [PATCH 27/44] sparc: remove leon_dma_ops Christoph Hellwig
2017-06-16 18:10 ` [PATCH 28/44] sparc: remove arch specific dma_supported implementations Christoph Hellwig
2017-06-16 18:10 ` [PATCH 29/44] dma-noop: remove dma_supported and mapping_error methods Christoph Hellwig
2017-06-16 18:10 ` [PATCH 30/44] dma-virt: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 31/44] hexagon: remove arch-specific dma_supported implementation Christoph Hellwig
2017-06-16 18:10 ` [PATCH 32/44] hexagon: remove the unused dma_is_consistent prototype Christoph Hellwig
2017-06-16 18:10 ` [PATCH 33/44] openrisc: remove arch-specific dma_supported implementation Christoph Hellwig
2017-06-16 18:10 ` [PATCH 34/44] arm: remove arch specific " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 35/44] x86: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 36/44] dma-mapping: remove HAVE_ARCH_DMA_SUPPORTED Christoph Hellwig
2017-06-16 18:10 ` [PATCH 37/44] mips/loongson64: implement ->dma_supported instead of ->set_dma_mask Christoph Hellwig
2017-06-16 18:10 ` [PATCH 38/44] arm: " Christoph Hellwig
2017-06-16 18:10 ` [PATCH 39/44] xen-swiotlb: remove xen_swiotlb_set_dma_mask Christoph Hellwig
2017-06-16 18:10 ` [PATCH 40/44] tile: remove dma_supported and mapping_error methods Christoph Hellwig
2017-06-16 18:10 ` [PATCH 41/44] powerpc/cell: clean up fixed mapping dma_ops initialization Christoph Hellwig
2017-06-16 18:10 ` [PATCH 42/44] powerpc/cell: use the dma_supported method for ops switching Christoph Hellwig
2017-06-17 20:50   ` Benjamin Herrenschmidt
2017-06-18  7:13     ` Christoph Hellwig [this message]
2017-06-18  9:54       ` Benjamin Herrenschmidt
2017-06-16 18:10 ` [PATCH 43/44] dma-mapping: remove the set_dma_mask method Christoph Hellwig
2017-06-16 18:10 ` [PATCH 44/44] powerpc: merge __dma_set_mask into dma_set_mask Christoph Hellwig
2017-06-20 12:41 ` new dma-mapping tree, was Re: clean up and modularize arch dma_mapping interface V2 Christoph Hellwig
2017-06-20 13:04   ` Stephen Rothwell
2017-06-20 13:16     ` Christoph Hellwig
2017-06-21 13:32       ` Marek Szyprowski
2017-06-22 21:53         ` Stephen Rothwell
2017-06-26  7:03         ` Christoph Hellwig
2017-06-20 13:14   ` Robin Murphy
2017-06-20 13:15     ` Christoph Hellwig
2017-06-21 19:24 ` tndave
2017-06-24  7:18   ` Christoph Hellwig
2017-06-24 15:36     ` Benjamin Herrenschmidt
2017-06-26  9:47       ` Christoph Hellwig
2017-06-26 22:06         ` tndave
  -- strict thread matches above, loose matches on Subject: below --
2017-06-08 13:25 clean up and modularize arch dma_mapping interface Christoph Hellwig
2017-06-08 13:26 ` [PATCH 42/44] powerpc/cell: use the dma_supported method for ops switching 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=20170618071344.GB18526@infradead.org \
    --to=hch@infradead.org \
    --cc=benh@kernel.crashing.org \
    --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).