From: Thomas Hellstrom <thellstrom@vmware.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: USB list <linux-usb@vger.kernel.org>,
dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: dma-buf and ->dev refcount fun
Date: Tue, 25 Mar 2014 10:01:29 +0100 [thread overview]
Message-ID: <533145E9.60503@vmware.com> (raw)
In-Reply-To: <CAKMK7uGcLTLbMD+YvL1oy7r+jj0P23ZoFEkKG-MJRaPADWugmw@mail.gmail.com>
On 03/25/2014 09:01 AM, Daniel Vetter wrote:
> On Tue, Mar 25, 2014 at 4:53 AM, Dave Airlie <airlied@gmail.com> wrote:
>> So I've got a reproducable oops with udl sharing from i915,
>>
>> start X, connect UDL, randr it into position, rip out udl device, kill X,
>>
>> we get an oops when dma_unmap_sg in i915_gem_unmap_dma_buf gets
>> called, attachment->dev is pointing to a freed structure, now the drm
>> + udl driver points dev->dev at the USB interface device, however when
>> the device is unplugged, the USB interface device disappears in a poof
>> of smoke, and we just keep a fake shell of the drm device around to
>> keep userspace happy.
>>
>> So I'm wondering if should be using a different device to create
>> dma-buf objects or whether dma-buf objects need to be keeping a
>> reference on the interface device,
> Don't do any mapping/attaching then since you never need to do dma
> anyway. And I guess if we ever need to do dma with usb devices for
> real we just need to teach the usb core about dma-bufs, so that the
> *hci can do the attaching and dma-mapping.
>
> On a quick look through udl_gem.c vmap will keep on working since it's
> already forwarded to i915. That leaves mmap - either your userspace
> doesn't need this for prime buffers or you'd need to implement that
> one too. Rob Clark had patches floating around for forwarding mmaping
> through dma-bufs between gem drivers a long time ago, Rob Bradford is
> working on dma-buf mmap support for i915.
Ouch, here we go!
I though the idea was *not* to implement dma-buf mmap() on the major
drivers :( ???
/Thomas
next prev parent reply other threads:[~2014-03-25 9:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 3:53 dma-buf and ->dev refcount fun Dave Airlie
2014-03-25 8:01 ` Daniel Vetter
2014-03-25 9:01 ` Thomas Hellstrom [this message]
[not found] ` <CAKMK7uGcLTLbMD+YvL1oy7r+jj0P23ZoFEkKG-MJRaPADWugmw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-25 9:40 ` David Herrmann
2014-03-25 10:11 ` Dave Airlie
2014-03-25 10:59 ` Daniel Vetter
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=533145E9.60503@vmware.com \
--to=thellstrom@vmware.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-usb@vger.kernel.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 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.