From: ebiederm@xmission.com (Eric W. Biederman)
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Ming Lei <ming.lei@canonical.com>,
Greg KH <gregkh@linuxfoundation.org>,
Wedson Almeida Filho <wedsonaf@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
<linux-kernel@vger.kernel.org>,
Linux PM List <linux-pm@vger.kernel.org>
Subject: Re: Race condition between driver_probe_device and device_shutdown
Date: Tue, 22 May 2012 13:16:10 -0600 [thread overview]
Message-ID: <87wr4458n9.fsf@xmission.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1205221008530.2100-100000@iolanthe.rowland.org> (Alan Stern's message of "Tue, 22 May 2012 10:11:41 -0400 (EDT)")
Alan Stern <stern@rowland.harvard.edu> writes:
> On Tue, 22 May 2012, Ming Lei wrote:
>
>> On Tue, May 22, 2012 at 2:29 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
>> > On Mon, 21 May 2012, Ming Lei wrote:
>> >> Another candidate fix is to register a reboot notifier in driver core to prevent
>> >> driver from being bound or unbound from start of reboot/shutdown, but looks
>> >> not easy as the way of holding device locks.
You might also be able to look at system_state and simply not do any
hotplug work if the state is neither SYSTEM_BOOTING or SYSTEM_RUNNING.
>> > I'd guess it was done this way so that the shutdown task wouldn't have
>> > to wait for a buggy driver that didn't want to release the device lock
>> > (or that crashed while holding the lock).
>>
>> Maybe, so I understand you agree on adding the device lock as did
>> in the patch, don't I?
>
> I don't know. It depends on the intention behind the shutdown
> callback. Maybe each driver is supposed to be responsible for doing
> its own locking.
>
> Do you think that a buggy driver should be able to prevent the system
> from shutting down?
The original intent of the shutdown callback was to just the hardware
part of the device shutdown and not do muck with kernel data structures
because just the device portion should be more reliable and was all
that is needed.
Given the current minimal usage of the device shutdown callback I'm not
convinced the original reasoning made sense but shrug. So we might
want to reorg things and merge remove and shutdown. I missed the start
of this thread so I don't know how ambitious everyone is.
Eric
next prev parent reply other threads:[~2012-05-22 19:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-18 4:59 Race condition between driver_probe_device and device_shutdown Greg KH
2012-05-20 14:08 ` Ming Lei
2012-05-20 19:51 ` Greg KH
2012-05-21 4:53 ` Ming Lei
2012-05-21 18:29 ` Alan Stern
2012-05-22 0:35 ` Ming Lei
2012-05-22 14:11 ` Alan Stern
2012-05-22 19:16 ` Eric W. Biederman [this message]
2012-05-23 10:05 ` Ming Lei
2012-05-23 15:06 ` Alan Stern
2012-05-24 1:39 ` Ming Lei
2012-05-24 2:14 ` Greg KH
2012-05-24 3:12 ` Ming Lei
2012-05-24 14:37 ` Alan Stern
2012-05-25 0:33 ` Ming Lei
2012-12-06 9:11 ` Race condition between driver_probe_device and device_shutdown Wedson Almeida Filho
2012-12-06 10:52 ` Ming Lei
2012-12-07 0:09 ` Wedson Almeida Filho
2012-12-07 3:42 ` Ming Lei
2012-12-07 12:16 ` Wedson Almeida Filho
2012-12-07 13:04 ` Ming Lei
2012-12-07 15:25 ` Alan Stern
2012-12-07 16:27 ` Ming Lei
-- strict thread matches above, loose matches on Subject: below --
2012-05-10 2:53 Race condition between driver_probe_device and device_shutdown Wedson Almeida Filho
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=87wr4458n9.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=ming.lei@canonical.com \
--cc=stern@rowland.harvard.edu \
--cc=wedsonaf@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox