From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Ming Lei <ming.lei@canonical.com>,
USB list <linux-usb@vger.kernel.org>,
Kernel development list <linux-kernel@vger.kernel.org>,
Paul McKenney <paulmck@linux.vnet.ibm.com>
Subject: Re: [PATCH] driver core: fix shutdown races with probe/remove
Date: Wed, 6 Jun 2012 05:21:37 +0900 [thread overview]
Message-ID: <20120605202137.GD27297@kroah.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1206051256130.1542-100000@iolanthe.rowland.org>
On Tue, Jun 05, 2012 at 01:09:45PM -0400, Alan Stern wrote:
> On Tue, 5 Jun 2012, Ming Lei wrote:
>
> > On Tue, Jun 5, 2012 at 10:47 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> > >
> > > Avoid running probe, that's fine. ?But avoiding remove can lead to
> > > problems, because the subsystem and the driver will no longer agree on
> > > who should manage the device.
> >
> > After device_shutdown() has been called, the whole system will enter power down
> > or reset later, so it doesn't matter if who should manage the device.
>
> Maybe. But there might be quite some time between the shutdown call
> and the eventual power-off or reboot.
>
> > Also once shutdown callback is called for the device, looks its other callbacks
> > should not touch the device any more.
>
> You shouldn't depend on that. Shutdown methods generally put the
> device into a state suitable for power-off or reboot; they don't often
> guarantee that the driver won't change the state later on.
>
> On the whole, it might be easier just to hold the device lock during
> the shutdown call.
That sounds much simpler to me.
greg k-h
next prev parent reply other threads:[~2012-06-05 20:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 8:59 [PATCH] driver core: fix shutdown races with probe/remove Ming Lei
2012-06-05 9:18 ` Greg Kroah-Hartman
2012-06-05 9:38 ` Ming Lei
2012-06-05 14:47 ` Alan Stern
2012-06-05 15:17 ` Ming Lei
2012-06-05 17:09 ` Alan Stern
2012-06-05 20:21 ` Greg Kroah-Hartman [this message]
2012-06-05 20:44 ` Alan Stern
2012-06-06 2:27 ` Ming Lei
2012-06-06 13:42 ` Paul E. McKenney
2012-06-06 15:21 ` Alan Stern
2012-06-06 15:48 ` Paul E. McKenney
2012-06-06 16:05 ` Alan Stern
2012-06-06 16:24 ` Paul E. McKenney
2012-06-06 14:44 ` Alan Stern
2012-06-06 15:14 ` Paul E. McKenney
2012-06-06 15:44 ` Alan Stern
2012-06-06 15:55 ` Paul E. McKenney
2012-06-06 16:58 ` Alan Stern
2012-06-06 23:24 ` Paul E. McKenney
2012-06-07 9:30 ` Ming Lei
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=20120605202137.GD27297@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ming.lei@canonical.com \
--cc=paulmck@linux.vnet.ibm.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