Linux Media Controller development
 help / color / mirror / Atom feed
From: 'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>
To: David Laight <David.Laight@ACULAB.COM>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Felipe Balbi <balbi@ti.com>,
	Sarah Sharp <sarah.a.sharp@linux.intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Subject: Re: [PATCH] usb: hcd: get/put device and hcd for hcd_buffers()
Date: Tue, 9 Dec 2014 10:24:04 -0500	[thread overview]
Message-ID: <20141209152404.GA29423@kroah.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CA04A1D@AcuExch.aculab.com>

On Mon, Dec 08, 2014 at 09:44:05AM +0000, David Laight wrote:
> From: Greg Kroah-Hartman
> > On Fri, Dec 05, 2014 at 09:03:57PM +0100, Sebastian Andrzej Siewior wrote:
> > > Consider the following scenario:
> > > - plugin a webcam
> > > - play the stream via gst-launch-0.10 v4l2src device=/dev/video0
> > > - remove the USB-HCD during playback via "rmmod $HCD"
> > >
> > > and now wait for the crash
> > 
> > Which you deserve, why did you ever remove a kernel module?  That's racy
> > and _never_ recommended, which is why it never happens automatically and
> > only root can do it.
> 
> Really drivers and subsystems should have the required locking (etc) to
> ensure that kernel modules can either be unloaded, or that the unload
> request itself fails if the device is busy.
> 
> It shouldn't be considered a 'shoot self in foot' operation.
> OTOH there are likely to be bugs.

This is not always the case, sorry, removing a kernel module is a known
racy condition, and sometimes adding all of the locking required to try
to make it "safe" just isn't worth it overall, as this is something that
_only_ a developer does.

greg k-h

  reply	other threads:[~2014-12-09 15:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 20:03 [PATCH] usb: hcd: get/put device and hcd for hcd_buffers() Sebastian Andrzej Siewior
2014-12-05 21:19 ` Greg Kroah-Hartman
2014-12-05 23:13   ` Sebastian Andrzej Siewior
2014-12-06  0:37     ` Greg Kroah-Hartman
2014-12-08  9:44   ` David Laight
2014-12-09 15:24     ` 'Greg Kroah-Hartman' [this message]
2014-12-09 16:01       ` Sebastian Andrzej Siewior
2014-12-09 16:54         ` 'Greg Kroah-Hartman'
2014-12-10 18:25           ` Sebastian Andrzej Siewior
2014-12-05 21:21 ` Alan Stern
2014-12-05 23:23   ` Sebastian Andrzej Siewior
2014-12-08  8:43     ` Sebastian Andrzej Siewior

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=20141209152404.GA29423@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=balbi@ti.com \
    --cc=bigeasy@linutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=sarah.a.sharp@linux.intel.com \
    --cc=stern@rowland.harvard.edu \
    /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