From: Randy Dunlap <rdunlap@xenotime.net>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Kay Sievers <kay.sievers@vrfy.org>,
Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] drivercore: Add driver probe deferral mechanism
Date: Mon, 4 Jul 2011 12:56:55 -0700 [thread overview]
Message-ID: <20110704125655.57de1f6e.rdunlap@xenotime.net> (raw)
In-Reply-To: <20110704170949.11059.92774.stgit@ponder>
On Mon, 04 Jul 2011 11:11:59 -0600 Grant Likely wrote:
> diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> index 6658da7..ccbf3d3 100644
> --- a/drivers/base/dd.c
> +++ b/drivers/base/dd.c
> @@ -28,6 +28,62 @@
> #include "base.h"
> #include "power/power.h"
>
> +/**
> + * deferred_probe_work_func() - Retry probing devices in the deferred list.
> + */
> +static DEFINE_MUTEX(deferred_probe_mutex);
> +static LIST_HEAD(deferred_probe_list);
> +static void deferred_probe_work_func(struct work_struct *work)
The kernel-doc notation needs to be immediately before the function,
without the intervening data...
> +{
> + struct device *dev;
> + /*
> + * This bit is tricky. We want to process every device in the
> + * deferred list, but devices can be removed from the list at any
> + * time while inside this for-each loop. There are two things that
> + * need to be protected against:
> + * - if the device is removed from the deferred_probe_list, then we
> + * loose our place in the loop. Since any device can be removed
> + * asynchronously, list_for_each_entry_safe() wouldn't make things
> + * much better. Simplest solution is to restart walking the list
> + * whenever the current device gets removed. Not the most efficient,
> + * but is simple to implement and easy to audit for correctness.
> + * - if the device is unregistered, and freed, then there is a risk
> + * of a null pointer dereference. This code uses get/put_device()
> + * to ensure the device cannot disappear from under our feet.
> + */
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
next prev parent reply other threads:[~2011-07-04 19:57 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-04 17:11 Grant Likely
2011-07-04 17:41 ` Greg KH
2011-07-04 17:56 ` Mark Brown
2011-07-04 18:01 ` Grant Likely
2011-07-05 14:21 ` Greg KH
2011-07-05 15:21 ` Arnd Bergmann
2011-07-05 15:50 ` Greg KH
2011-07-05 16:05 ` Arnd Bergmann
2011-07-05 16:27 ` Grant Likely
2011-07-05 16:11 ` Kay Sievers
2011-07-05 16:28 ` Grant Likely
2011-07-05 16:36 ` Greg KH
2011-07-05 17:17 ` Grant Likely
2011-07-05 17:29 ` Greg KH
2011-07-05 17:35 ` Grant Likely
2011-07-10 14:24 ` Kay Sievers
2011-07-05 16:33 ` Grant Likely
2011-07-05 16:05 ` Grant Likely
2011-07-04 19:56 ` Randy Dunlap [this message]
2011-07-04 20:47 ` Mark Brown
2011-07-04 23:25 ` Grant Likely
2011-07-05 6:11 ` Mark Brown
2012-03-05 15:47 Grant Likely
2012-03-05 17:38 ` Alan Cox
2012-03-05 17:40 ` David Daney
2012-03-05 17:50 ` Mark Brown
2012-03-05 19:15 ` Arnd Bergmann
2012-03-05 21:10 ` Grant Likely
2012-03-05 21:24 ` Greg Kroah-Hartman
2012-03-05 21:28 ` Mark Brown
2012-03-06 9:10 ` Arnd Bergmann
2012-03-05 21:47 ` Greg Kroah-Hartman
2012-03-05 22:09 ` Grant Likely
2012-03-05 22:15 ` Greg Kroah-Hartman
2012-03-06 0:08 ` Grant Likely
2012-03-06 5:28 ` Greg Kroah-Hartman
2012-03-06 7:52 ` Grant Likely
2012-03-08 20:22 ` Greg KH
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=20110704125655.57de1f6e.rdunlap@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=davem@davemloft.net \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@suse.de \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/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
all inboxes | Powered by JetHome®