linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: Minchan Kim <minchan@kernel.org>
Cc: Hyesoo Yu <hyesoo.yu@samsung.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	 Matthew Wilcox <willy@infradead.org>,
	david@redhat.com, iamjoonsoo.kim@lge.com,  vbabka@suse.cz,
	Suren Baghdasaryan <surenb@google.com>,
	KyongHo Cho <pullip.cho@samsung.com>,
	 John Dias <joaodias@google.com>,
	Hridya Valsaraju <hridya@google.com>,
	 Sumit Semwal <sumit.semwal@linaro.org>,
	Brian Starkey <Brian.Starkey@arm.com>,
	 linux-media <linux-media@vger.kernel.org>,
	 "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>, Rob Herring <robh@kernel.org>,
	 Christian Koenig <christian.koenig@amd.com>,
	 "moderated list:DMA BUFFER SHARING FRAMEWORK"
	<linaro-mm-sig@lists.linaro.org>,
	 Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Subject: Re: [PATCH 4/4] dma-heap: Devicetree binding for chunk heap
Date: Thu, 10 Dec 2020 14:40:38 -0800	[thread overview]
Message-ID: <CALAqxLVz5bCYxehjVtCJ5eEJ-Wz81=fe30sqRtYtZpXWMkXZiw@mail.gmail.com> (raw)
In-Reply-To: <X9JHjPTdxv6Z7lCW@google.com>

On Thu, Dec 10, 2020 at 8:06 AM Minchan Kim <minchan@kernel.org> wrote:
> On Thu, Dec 10, 2020 at 12:15:15AM -0800, John Stultz wrote:
> > Well, while I agree that conceptually the dmabuf heaps allow for
> > allocations for multi-device pipelines, and thus are not tied to
> > specific devices. I do think that the memory types exposed are likely
> > to have specific devices/drivers in the pipeline that it matters most
> > to. So I don't see a big issue with the in-kernel driver registering a
> > specific CMA region as a dmabuf heap.
>
> Then, I am worry about that we spread out dma_heap_add_cma to too many
> drivers since kernel doesn't how userspace will use it.
> For example, system 1 could have device A-B-C pipeline so they added
> it A driver. After that, system 2 could have device B-C-D pipeline
> so they add dma_heap_add_cma into B device.

I'm not sure I see this as a major issue? If the drivers add it based
on the dt memory reference, those will be configured to not add
duplicate heaps (and even so the heap driver can also ensure we don't
try to add a heap twice).

> > Yea, an un-upstreamable dummy driver is maybe what it devolves to in
> > the worst case. But I suspect it would be cleaner for a display or ISP
> > driver that benefits most from the heap type to add the reserved
> > memory reference to their DT node, and on init for them to register
> > the region with the dmabuf heap code.
>
> As I mentioned above, it could be a display at this moment but it could
> be different driver next time. If I miss your point, let me know.
>

I guess I just don't see potentially having the registration calls
added to multiple drivers as a big problem.

Ideally, yes, I'd probably rather see a DT node that would allow the
heap driver to register specified regions, but that's been NACKed
multiple times. Given that, having hooks in device drivers to export
the region seems to me like the next best approach, as it avoids DT
ABI ( if ends up its a bad approach, its not something we have to
keep).

The bigger problem right now is not that there are too many places the
registration call would be made from, but that there aren't upstream
drivers which I'm aware of where it would currently make sense to add
specific dma_heap_add_cma() registration hooks to.  We need an
upstream user of Kunihiko Hayashi's patch.

thanks
-john


  reply	other threads:[~2020-12-10 22:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17 18:19 [PATCH 0/4] Chunk Heap Support on DMA-HEAP Minchan Kim
2020-11-17 18:19 ` [PATCH 1/4] mm: introduce cma_alloc_bulk API Minchan Kim
2020-11-23 14:15   ` David Hildenbrand
2020-11-25 20:12     ` Minchan Kim
2020-11-17 18:19 ` [PATCH 2/4] dma-buf: add export symbol for dma-heap Minchan Kim
2020-11-18  5:18   ` John Stultz
2020-11-17 18:19 ` [PATCH 3/4] dma-buf: heaps: add chunk heap to dmabuf heaps Minchan Kim
2020-11-18  9:00   ` Hillf Danton
2020-11-19  1:16     ` Hyesoo Yu
2020-11-17 18:19 ` [PATCH 4/4] dma-heap: Devicetree binding for chunk heap Minchan Kim
2020-11-18  3:00   ` John Stultz
2020-11-19  1:14     ` Hyesoo Yu
2020-11-19  3:19       ` John Stultz
2020-11-19  6:30         ` Hyesoo Yu
2020-12-09 23:53         ` Minchan Kim
2020-12-10  8:15           ` John Stultz
2020-12-10 16:06             ` Minchan Kim
2020-12-10 22:40               ` John Stultz [this message]
2020-12-10 23:30                 ` Minchan Kim
2020-12-08 16:56 ` [PATCH 0/4] Chunk Heap Support on DMA-HEAP Nicolas Dufresne

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='CALAqxLVz5bCYxehjVtCJ5eEJ-Wz81=fe30sqRtYtZpXWMkXZiw@mail.gmail.com' \
    --to=john.stultz@linaro.org \
    --cc=Brian.Starkey@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=christian.koenig@amd.com \
    --cc=david@redhat.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=hridya@google.com \
    --cc=hyesoo.yu@samsung.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=joaodias@google.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=pullip.cho@samsung.com \
    --cc=robh@kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.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).