From: Laura Abbott <labbott@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Feng Tang <feng.tang@intel.com>
Cc: Michal Nazarewicz <mina86@mina86.com>,
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>,
Sumit Semwal <sumit.semwal@linaro.org>
Subject: Re: [PATCH v2] staging: ion: Add a default struct device for cma heap
Date: Fri, 7 Aug 2015 16:09:12 -0700 [thread overview]
Message-ID: <55C53A98.7030403@redhat.com> (raw)
In-Reply-To: <20150807180546.GD10282@kroah.com>
On 08/07/2015 11:05 AM, Greg Kroah-Hartman wrote:
> On Fri, Aug 07, 2015 at 11:50:04PM +0800, Feng Tang wrote:
>> On Fri, Aug 07, 2015 at 04:48:28PM +0200, Michal Nazarewicz wrote:
>>> On Fri, Aug 07 2015, Feng Tang wrote:
>>>> As I described above, the dummy struct device is only needed for
>>>> dma request, its lifetime is align with the cma_heap itself.
>>>
>>> Again, this is from perspective of someone who is unfamiliar with ION,
>>> but perhaps a viable solution is to bypass DMA API and just call
>>> cma_alloc directly?
>>
>> 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 I'm afraid we can't direcly call cma_alloc directly here.
>
> Ick. But using a "fake" struct device here, for no real reason,
> makes me very nervous that you are going to hit a codepath somewhere
> that assumes this is a "real" struct device and tries to do something
> with it (dev_printk(), look up what bus it is on, change the name of it,
> etc.) Trying to fake out the subsystem in this manner is a sign that
> something is really wrong here.
>
> Please either make this a real device, or fix up the api to not need
> this type of thing.
>
I think this issue represents one of the many current issues with Ion.
When the void * == struct dev was added, everything was working off of
board files. We now have devicetree which makes the device association
even more awkward to pull off. Every vendor out there is doing something
different right now so the assertion in the commit text about 'normal'
is not true; existing code has managed to work with the (not super great)
API.
There is going to be an Ion session at Plumbers in a few weeks. I'd like
to propose holding off on merging anything until after plumbers when
there can be some more discussion about what would be a reasonable API,
taking into consideration the points brought up in this patch series.
Thanks,
Laura
next prev parent reply other threads:[~2015-08-07 23:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-07 3:50 [PATCH v2] staging: ion: Add a default struct device for cma heap 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 [this message]
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
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=55C53A98.7030403@redhat.com \
--to=labbott@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=feng.tang@intel.com \
--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 \
--cc=sumit.semwal@linaro.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