All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Starkey <Brian.Starkey@arm.com>
To: "Andrew F. Davis" <afd@ti.com>
Cc: nd <nd@arm.com>, Chenbo Feng <fengc@google.com>,
	Alistair Strachan <astrachan@google.com>,
	Liam Mark <lmark@codeaurora.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [EARLY RFC][PATCH] dma-buf: Add dma-buf heaps framework
Date: Tue, 5 Mar 2019 18:22:48 +0000	[thread overview]
Message-ID: <20190305182248.rgzdkemdpslfvfve@DESKTOP-E1NTVVP.localdomain> (raw)
In-Reply-To: <05f41d32-2a53-7116-691b-d3c843eae9d1@ti.com>

On Mon, Mar 04, 2019 at 08:53:42AM -0600, Andrew F. Davis wrote:
> On 3/1/19 6:06 AM, Brian Starkey wrote:
> > 
> > Am I right in thinking "cmd" comes from userspace? It might be a good
> > idea to not trust _IOC_SIZE(cmd) and use our own. I'm looking at
> > Documentation/ioctl/botching-up-ioctls.txt and drm_ioctl()
> > 
> 
> Yes cmd is from userspace, but we are in a switch-case that has already
> matched cmd == DMA_HEAP_IOC_ALLOC which is sized correctly.
> 

Ah yeah, sorry I missed that. It's fine until the struct gets
extended, which can be handled if/when.

[snip]

> > 
> > For me, the main thing that's missing is a way to unregister a heap.
> > If drivers/modules are registering heaps, then they also need to be
> > able to remove them again when they go away (rmmod or whatever).
> > 
> > I think that starts to be quite a can of worms, as you might end up
> > with buffers which outlive their allocator (that's true today as well
> > afaik, but is in drivers rather than something more central).
> > 
> 
> Yeah, was wanting to avoid dealing with all that, at least to start out
> with. At a high level memory shouldn't ever just disappear, we should
> block removing a heap driver until all buffers have been released.
> 

Correct me if I'm wrong, but I don't think there's a mechanism in the
kernel to do that right now is there? If my DRM driver registers a
heap, and then gets rmmod-ed, then kaboom. Just not exporting the
symbol might be OK to start with.

Thanks,
-Brian
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2019-03-05 18:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 14:36 [EARLY RFC][PATCH] dma-buf: Add dma-buf heaps framework Andrew F. Davis
2019-02-25 18:41 ` John Stultz
2019-02-26  0:20 ` John Stultz
2019-02-26 14:02   ` Andrew F. Davis
2019-02-26  0:55 ` John Stultz
2019-02-26 14:04   ` Andrew F. Davis
2019-02-26  3:53 ` Sumit Semwal
2019-02-26 14:28   ` Andrew F. Davis
2019-02-26  6:20 ` John Stultz
2019-02-26 14:46   ` Andrew F. Davis
2019-02-26 19:21     ` John Stultz
2019-02-26 23:40       ` John Stultz
2019-02-27 16:38         ` Andrew F. Davis
2019-02-27 21:55           ` John Stultz
2019-02-28 15:20             ` Andrew F. Davis
2019-03-01 23:49               ` John Stultz
2019-02-26 14:12 ` Benjamin Gaignard
2019-02-26 15:05   ` Andrew F. Davis
2019-02-26 15:22   ` Linus Walleij
2019-02-27 23:22 ` Laura Abbott
2019-02-28  0:14   ` John Stultz
2019-03-01 12:06 ` Brian Starkey
2019-03-04 14:53   ` Andrew F. Davis
2019-03-05  1:16     ` John Stultz
2019-03-05 18:05       ` Andrew F. Davis
2019-03-05 18:45         ` John Stultz
2019-03-05 18:22     ` Brian Starkey [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=20190305182248.rgzdkemdpslfvfve@DESKTOP-E1NTVVP.localdomain \
    --to=brian.starkey@arm.com \
    --cc=afd@ti.com \
    --cc=astrachan@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fengc@google.com \
    --cc=lmark@codeaurora.org \
    --cc=nd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.