mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: Michal Nazarewicz <mina86@mina86.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	John Stultz <john.stultz@linaro.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] staging: ion: Add a default struct device for cma heap
Date: Sun, 9 Aug 2015 17:12:38 +0800	[thread overview]
Message-ID: <20150809091238.GB10856@shbuild888> (raw)
In-Reply-To: <xa1toaiivzbf.fsf@mina86.com>

On Sat, Aug 08, 2015 at 12:39:48PM +0200, Michal Nazarewicz wrote:
> On Fri, Aug 07 2015, Feng Tang wrote:
> > For ion cma heap, the buffer allocation func ion_cma_allocate() will
> > call dma_alloc_coherent(dev, ...). And dma_alloc_coherent() is
> > implemented by each architeture(arm/m68k/x86 etc), and many Arch's
> > implementation doesn't use cma, but use alloc_pages() like APIs.
> 
> So what you’re saying is that ‘ION CMA heap’ is a misnomer since it has
> to do with CMA only if given architecture implements dma_alloc_coherent
> using CMA.  It should rather be called ‘ION DMA coherent heap’.

> This leads to realisation that the code should be oblivious to CMA areas
> and never operate on them directly (e.g. never accept struct cma * or
> use dev_set_cma_area).  In the current form, if architecture does not
> use CMA, the whole dev_set_cma_area shenanigans are pointless.

I'm not very familiar with the history of ion cma code, my guess is
there are quite a few Arch's are using ion/cma actually, but their
drivers are off mainline tree. 

Like currently, many android devices are using ion (checking the 
products on current market or reading code in Android AOSP code),
but the only ion platform driver sits in mainline is tegra_ion.c

And if a architecture doesn't use cma, then their ion platform
driver just simply does't set the "struct cma *"

Thanks,
Feng

      reply	other threads:[~2015-08-09  9:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07  3:50 Feng Tang
2015-08-07  4:54 ` Greg Kroah-Hartman
2015-08-07  6:46   ` Feng Tang
2015-08-07 14:48     ` Michal Nazarewicz
2015-08-07 15:50       ` Feng Tang
2015-08-07 18:05         ` Greg Kroah-Hartman
2015-08-07 23:09           ` Laura Abbott
2015-08-08 22:18             ` Greg Kroah-Hartman
2015-08-09  8:47               ` Feng Tang
2015-08-08 10:39         ` Michal Nazarewicz
2015-08-09  9:12           ` Feng Tang [this message]

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=20150809091238.GB10856@shbuild888 \
    --to=feng.tang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=john.stultz@linaro.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mina86@mina86.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

all inboxes | Powered by JetHome®