All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/4] base: Introduce deferred probing
Date: Mon, 13 Apr 2015 16:26:12 +0200	[thread overview]
Message-ID: <552BD204.5060808@gmail.com> (raw)
In-Reply-To: <20150413065403.GX9742@pengutronix.de>

On 13.04.2015 08:54, Sascha Hauer wrote:
> On Fri, Apr 10, 2015 at 03:02:43AM +0200, Sebastian Hesselbarth wrote:
>> As expected, we would need deferred probing sooner or later. This is
>> a first approach to allow devices to return -EPROBE_DEFER and get
>> sorted into a list of deferred devices that will be re-probed later.
[...}
>> +static int device_probe_deferred(void)
>> +{
>> +	struct device_d *dev, *tmp;
>> +	struct driver_d *drv;
>> +	int retries = 10;
>> +
>> +	do {
>> +		if (list_empty(&deferred))
>> +			break;
>> +
>> +		list_for_each_entry_safe(dev, tmp, &deferred, active) {
>> +			list_del(&dev->active);
>> +
>> +			if (dev->bus) {
>> +				bus_for_each_driver(dev->bus, drv) {
>> +					if (!match(drv, dev))
>> +						break;
>> +				}
>> +				device_probe(dev);
>> +			}
>> +		}
>> +	} while (retries--);
>
> Instead of a hardcoded loop counter I think this should be "while at least
> one device successfully probed". Also if probe fails and the return
> value is still -EPROBE_DEFER you have to add the device to the deferred
> list again.

Sascha,

agreed. I'll have another look at how deferred probing is handled here
and resend once I have implemented your comments above.

Sebastian


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-04-13 14:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10  1:02 [PATCH 0/4] Introduce deferred probing Sebastian Hesselbarth
2015-04-10  1:02 ` [PATCH 1/4] base: " Sebastian Hesselbarth
2015-04-13  6:54   ` Sascha Hauer
2015-04-13 14:26     ` Sebastian Hesselbarth [this message]
2015-04-10  1:02 ` [PATCH 2/4] gpio: Return -EPROBE_DEFER on gpio_get_num() Sebastian Hesselbarth
2015-04-10  1:02 ` [PATCH 3/4] OF: gpio: Silence error message on -EPROBE_DEFER Sebastian Hesselbarth
2015-04-10  1:02 ` [PATCH 4/4] led: gpio: Properly deal with deferred probing Sebastian Hesselbarth
2015-04-13  8:14 ` [PATCH 0/4] Introduce " Sascha Hauer

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=552BD204.5060808@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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.