All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Cheng, Yao" <yao.cheng@intel.com>
Cc: "daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"emil.l.velikov@gmail.com" <emil.l.velikov@gmail.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Chehab, John" <john.chehab@intel.com>,
	"Jiang, Fei" <fei.jiang@intel.com>,
	"Barbalho, Rafael" <rafael.barbalho@intel.com>,
	"Beckett, Robert" <robert.beckett@intel.com>
Subject: Re: [Intel-gfx] [RFC PATCH v3 1/4] drm/i915: add i915_ved.c to setup bridge for VED
Date: Mon, 1 Dec 2014 09:32:24 +0100	[thread overview]
Message-ID: <20141201083224.GO32117@phenom.ffwll.local> (raw)
In-Reply-To: <8FF7D634BEE4C2428EFFAB6B7E919E4B0183500A@shsmsx102.ccr.corp.intel.com>

On Mon, Dec 01, 2014 at 03:04:27AM +0000, Cheng, Yao wrote:
> > -----Original Message-----
> > From: Beckett, Robert
> > Sent: Saturday, November 29, 2014 0:59
> > To: Cheng, Yao; intel-gfx@lists.freedesktop.org; dri-
> > devel@lists.freedesktop.org; daniel.vetter@ffwll.ch; Kelley, Sean V; Chehab,
> > John
> > Cc: emil.l.velikov@gmail.com; Jiang, Fei; dh.herrmann@gmail.com;
> > daniel@fooishbar.org
> > Subject: Re: [Intel-gfx] [RFC PATCH v3 1/4] drm/i915: add i915_ved.c to setup
> > bridge for VED
> > > + * Threats:
> > > + * Due to the restriction in Linux platform device model, user need
> > > +manually
> > > + * uninstall ipvr driver before uninstalling i915 module, otherwise
> > > +he might
> > > + * run into use-after-free issues after i915 removes the platform device.
> > 
> > Can you go in to more detail on what you consider to be the restriction in the
> > platform device model?
> > 
> > When removing the device via platform_device_unregister, it will call the
> > remove callback of any drivers handling this device (via the bus remove
> > function). It is then up to the driver to ensure no further usage of the device
> > from which it is being removed. This usually involves removing all user input
> > vectors, disabling interrupts involved and flushing/canceling any delayed
> > work. This should prevent any further use of the device by the driver.
> > 
> > The driver's remove function is called in a direct call chain from
> > platform_device_unregister, so by the time it returns, there should be no
> > further chance of accesses.
> >
> 
> Bob, thx for your review comments.
> The symptom is, after "rmmod i915", though drm_drv_release() is also
> called on the child device "ipvr", I still see the module exist in the
> system (check it by "lsmod"). This causes issue when I modprobe i915 and
> ipvr again later. Actually I don't understand why this restriction
> exists, but accroding to Daniel, grabbing a module refcount for the
> platform device doesn't work (it would pin the module forever).

Btw this entire story with platform drivers make unload a mess was just a
best guess from my side why module unloading doesn't work well or could
blow up. I've thought platform drivers registered from modules are
inheritely racy, but I'll be very happy to learn that this is a
misunderstanding on my side ;-)

Wrt the testcase I'm fairly pragmatic though: Whatever makes it work
reliably is good enough for me, even if it's a gross hack (we already need
to manually kick fbcon anyway).
Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2014-12-01  8:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 19:06 [RFC PATCH v3 0/4] drm driver for VED in Intel GPU Yao Cheng
2014-11-21 19:06 ` [RFC PATCH v3 1/4] drm/i915: add i915_ved.c to setup bridge for VED Yao Cheng
2014-11-28 16:59   ` Robert Beckett
2014-12-01  3:04     ` Cheng, Yao
2014-12-01  8:32       ` Daniel Vetter [this message]
2014-11-21 19:06 ` [RFC PATCH v3 2/4] drm/ipvr: drm driver " Yao Cheng
2014-11-23 13:29   ` Cheng, Yao
2014-11-26 16:50   ` Cheng, Yao
2014-11-27 11:49   ` Cheng, Yao
2014-12-01  3:09     ` Cheng, Yao

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=20141201083224.GO32117@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=fei.jiang@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=john.chehab@intel.com \
    --cc=rafael.barbalho@intel.com \
    --cc=robert.beckett@intel.com \
    --cc=yao.cheng@intel.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.