linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Vladimir Murzin <vladimir.murzin@arm.com>,
	Christoph Hellwig <hch@lst.de>,
	Vitaly Kuzmichev <vitaly_kuzmichev@mentor.com>,
	gregkh@linuxfoundation.org, m.szyprowski@samsung.com,
	linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
	"George G. Davis" <george_davis@mentor.com>
Subject: Re: [PATCH v2 1/2] drivers: dma-coherent: Fix dev->cma_area vs dev->dma_mem breakage
Date: Tue, 11 Jul 2017 16:19:37 +0200	[thread overview]
Message-ID: <20170711141937.GA12884@lst.de> (raw)
In-Reply-To: <6f26f0d9-506a-76bf-1410-19b00162c4a1@arm.com>

On Fri, Jul 07, 2017 at 05:06:52PM +0100, Robin Murphy wrote:
> I don't think we need to go that far, I reckon it would be clear enough
> to just split the per-device vs. global pool interfaces, something like
> I've sketched out below (such that the ops->alloc implementation calls
> dma_alloc_from_global_coherent() if dma_alloc_from_contiguous() fails).
> 
> If anyone wants to take that and run with it, feel free.

I like this basic idea.  It also fits into one of my plans for the
4.14 merge window - I want to enhance the lib/dma-noop.c so that
it can use different allocators and mapping helpers, e.g. for
the allocators what makes sense is:

 (1) simple page allocator (as-is)
 (2) CMA
 (3) swiotlb
 (4) the OF coherent allocator from your draft patch

and then for the mapping into phys space we can use

 (1) virto_to_phys (as-is)
 (2) arch helper (e.g. like done in mips plat support)
 (3) maybe some common form of ioremap / vmap instead of various
     duplicates

With that we should be able to cosolidate most direct mapped
dma_ops for architectures that do not require cache flushing into
common code.  As a next step we could think about useful cache
flushing hooks.

  parent reply	other threads:[~2017-07-11 14:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03 14:51 [PATCH 0/2] Implement default DMA coherent pool vitaly_kuzmichev
2017-07-03 14:51 ` [PATCH 1/2] drivers: dma-coherent: Add support for " vitaly_kuzmichev
2017-07-04 21:02   ` kbuild test robot
2017-07-05  5:55   ` kbuild test robot
2017-07-10  0:36   ` Rob Herring
2017-07-03 14:51 ` [PATCH 2/2] drivers: dma-coherent: show per-device DMA region utilization via procfs vitaly_kuzmichev
2017-07-07 13:22 ` [PATCH v2 0/2] Additions to default DMA coherent pool Vitaly Kuzmichev
2017-07-07 13:22   ` [PATCH v2 1/2] drivers: dma-coherent: Fix dev->cma_area vs dev->dma_mem breakage Vitaly Kuzmichev
2017-07-07 14:27     ` Christoph Hellwig
2017-07-07 15:40       ` Vladimir Murzin
2017-07-07 16:06         ` Robin Murphy
2017-07-07 16:44           ` Vladimir Murzin
2017-07-07 17:55             ` Robin Murphy
2017-07-10 13:42               ` Vladimir Murzin
2017-07-11 14:19           ` Christoph Hellwig [this message]
2017-07-07 13:23   ` [PATCH v2 2/2] drivers: dma-coherent: show per-device DMA region utilization via procfs Vitaly Kuzmichev
2017-07-07 14:28     ` Christoph Hellwig
2017-07-07 13:55   ` [PATCH v2 0/2] Additions to default DMA coherent pool Stephen Rothwell

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=20170711141937.GA12884@lst.de \
    --to=hch@lst.de \
    --cc=george_davis@mentor.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    --cc=vitaly_kuzmichev@mentor.com \
    --cc=vladimir.murzin@arm.com \
    /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).