linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: frowand.list@gmail.com,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Tomeu Vizoso" <tomeu.vizoso@collabora.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@codeaurora.org>,
	"Vinod Koul" <vinod.koul@intel.com>,
	"Dan Williams" <dan.j.williams@intel.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Alexandre Courbot" <gnurou@gmail.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"David Airlie" <airlied@linux.ie>,
	"Terje Bergström" <tbergstrom@nvidia.com>,
	"Stephen Warren" <swarren@wwwdotorg.org>,
	"Wolfram Sang" <wsa@the-dreams.de>,
	"Grant Likely" <grant.likely@linaro.org>,
	"Kishon Vijay Abraham I" <kishon@ti.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Dmitry Eremin-Solenikov" <dbaryshkov@gmail.com>,
	"David Woodhouse" <dwmw2@infradead.org>
Subject: Re: Alternative approach to solve the deferred probe
Date: Wed, 21 Oct 2015 21:13:48 +0300	[thread overview]
Message-ID: <5627D5DC.1040708@ti.com> (raw)
In-Reply-To: <20151021172042.GJ32532@n2100.arm.linux.org.uk>

Hi Russell,

On 10/21/2015 08:20 PM, Russell King - ARM Linux wrote:
> On Wed, Oct 21, 2015 at 07:55:29PM +0300, Grygorii Strashko wrote:
>> On 10/21/2015 06:36 PM, Frank Rowand wrote:
>>> The above is currently the last point for probe to succeed or defer
>>> (until possibly, as you mentioned, module loading resolves the defer).
>>> If a probe defers above, it will defer again below.  The set of defers
>>> should be exactly the same above and below.
>>>
>>
>> Unfortunately this is not "the last point for probe to succeed or defer".
> 
> Of course it isn't.  Being pedantic, there's actually no such thing,
> because the point that the kernel as finished booting can never actually
> be determined with things like modules being present.  That's something
> I've acknowledged from the start of this.
> 
>> There are still a bunch of drivers in Kernel which will be probed at late_initcall() level.
>> (like ./drivers/net/ethernet/ti/cpsw.c => late_initcall(cpsw_init);
>> Yes - they probably need to be updated to use module_init(), but that's what
>> we have now). Those drivers will re-trigger deferred device probing if their
>> probe succeeded.
> 
> Maybe this particular late_initcall() which triggers off the deferred
> probing should be moved to its own really_late_initcall() which happens
> as the very last thing - I think this is intended to run after everything
> else has had a chance to probe once.
> 
>> As result, it is impossible to say when will it happen the
>> "final round of deferred device probing" :( and final list of drivers
>> which was "deferred forever" will be know only when kernel exits to
>> User space  ("deferred forever" - before loading modules).
>>
>> May be, we also can consider adding debug_fs entry which can be used to
>> display actual state of deferred_probe_pending_list?
> 
> There are complaints in this thread about the existing deferred probing
> implementation being hard to debug - where it's known that a device
> has deferred, but it's not known why that happened.
> 
> That would be solved by my proposal, as this final round of probing
> before entering userspace after _all_ normal device probes have been
> attempted once and then we've tried to satisfy the deferred probe
> (okay, that's what it's _supposed_ to be - and as it takes three lines
> to write it, you'll excuse me if I just use the abbreviated "final
> round of deferred probe" which is much shorter - but remember that
> the long version is what I actually mean) would produce a list of
> not only the devices that failed to probe, but also the cause of the
> deferred probes.
> 
> My proposal would ensure that subsystems are happier to add these
> prints, because in the normal scenario where we have deferred probing,
> we're not littering the console log with lots of useless failure
> messages which make people stop and think "now did device X probe?"
> It also means scripts in our boot farms can more effectively analyse
> the log and determine whether the boot was actually successful and
> contained no errors.
> 
> Merely printing the list of devices which have been deferred is next
> to useless.  The next question will always be "why did device X defer?"
> and if that can't be answered, it means people having to spend a long
> time adding lots of printks to the kernel at lots of -EPROBE_DEFER
> returning sites or in the relevant drivers, tracing through the code
> back towards the -EPROBE_DEFER sites to try and track it down.
> 

I perfectly understand your proposal and spent a lot of time trying to
debug such kind issues also (and using printks).  

But I worry a bit (and that my main point) about these few additional
rounds of deferred device probing which I have right now and which allows
some of drivers to finish, finally, their probes successfully.
With proposed change I'll get more messages in boot log, but some of
them will belong to drivers which have been probed successfully and so,
they will be not really useful.

As result, I think, the most important thing is to identify (or create)
some point during kernel boot when it will be possible to say that all
built-in drivers (at least) finish their probes 100% (done or defer).

Might be do_initcalls() can be updated (smth like this):
static void __init do_initcalls(void)
{
	int level;

	for (level = 0; level < ARRAY_SIZE(initcall_levels) - 1; level++)
		do_initcall_level(level);

+	wait_for_device_probe();
+	/* Now one final round, reporting any devices that remain deferred */
+	driver_deferred_probe_report = true;
+	driver_deferred_probe_trigger();
+	wait_for_device_probe();
}

Also, in my opinion, it will be useful if this debugging feature will be optional.

Thanks.
-- 
regards,
-grygorii
S/ILKP

  reply	other threads:[~2015-10-21 18:14 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14  8:34 [GIT PULL] On-demand device probing Tomeu Vizoso
2015-10-14  9:26 ` Mark Brown
2015-10-15 11:42   ` Tomeu Vizoso
     [not found]     ` <1444909328-24761-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2015-10-16 21:23       ` Olof Johansson
2015-10-17 15:19         ` Rob Herring
2015-10-19 16:52           ` Olof Johansson
2015-10-17  6:57 ` Greg Kroah-Hartman
2015-10-17 15:04   ` Rob Herring
2015-10-17 15:47     ` Greg Kroah-Hartman
2015-10-17 16:28       ` Rob Herring
2015-10-17 16:56         ` Greg Kroah-Hartman
2015-10-17 17:54           ` Rob Clark
2015-10-17 18:27             ` Greg Kroah-Hartman
2015-10-17 18:45               ` Rob Clark
2015-10-17 18:59                 ` Greg Kroah-Hartman
2015-10-17 19:39                   ` Rob Clark
2015-10-17 20:22                     ` Greg Kroah-Hartman
2015-10-17 19:04                 ` Noralf Trønnes
2015-10-17 19:48                   ` Rob Clark
2015-10-18 19:41       ` Mark Brown
2015-10-18 19:29   ` Mark Brown
2015-10-18 19:37     ` Greg Kroah-Hartman
2015-10-18 19:53       ` Mark Brown
2015-10-19  9:44         ` David Woodhouse
2015-10-19  9:52           ` Russell King - ARM Linux
2015-10-19 11:02           ` Mark Brown
2015-10-19 12:35           ` Rob Herring
2015-10-19 12:47             ` David Woodhouse
2015-10-19 14:50               ` Mark Brown
2015-10-19 15:29                 ` David Woodhouse
2015-10-19 15:43                   ` Russell King - ARM Linux
2015-10-19 18:27                     ` Uwe Kleine-König
2015-10-19 18:39                       ` Russell King - ARM Linux
2015-10-19 23:47                         ` Alexandre Courbot
2015-10-20  7:14                           ` gpiod API considerations [Was: [GIT PULL] On-demand device probing] Uwe Kleine-König
2015-10-20 11:12                     ` [GIT PULL] On-demand device probing David Woodhouse
2015-10-19 15:58                   ` Rob Herring
2015-10-19 21:40                     ` Rafael J. Wysocki
2015-10-19 22:58                       ` Rob Herring
     [not found]                         ` <CAL_JsqKa3MFJUWKV2KxPE_NmrP2g4dOD3zr+0Kyx4yBkDOg2HA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-20  7:56                           ` Rafael J. Wysocki
2015-10-20 14:15                             ` Rob Herring
     [not found]                               ` <CAL_JsqJuu5_Osqi+X6M6UeRDZFQB+_8riYDF1gvsGayk5-4SFw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-20 14:40                                 ` Alan Stern
2015-10-20 15:36                                   ` Mark Brown
2015-10-20 16:04                                     ` Alan Stern
2015-10-20 16:21                                       ` Tomeu Vizoso
2015-10-20 17:14                                         ` Alan Stern
2015-10-20 19:35                                           ` Mark Brown
2015-10-20 23:35                                             ` Rafael J. Wysocki
2015-10-21  6:15                                               ` Jean-Francois Moine
2015-10-22  0:54                                         ` Rafael J. Wysocki
2015-10-22  9:14                                           ` Tomeu Vizoso
2015-10-27  5:03                                       ` Rafael J. Wysocki
2015-10-20 23:34                               ` Rafael J. Wysocki
2015-10-21  8:55                                 ` Geert Uytterhoeven
2015-10-21 23:39                                   ` Rafael J. Wysocki
2015-10-19 16:04                   ` Mark Brown
2015-10-19 12:34         ` Tomeu Vizoso
2015-10-19 13:18           ` Russell King - ARM Linux
     [not found]             ` <20151019131821.GA32532-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-10-19 14:10               ` Tomeu Vizoso
2015-10-19 14:30                 ` Russell King - ARM Linux
2015-10-19 15:00                   ` Tomeu Vizoso
2015-10-19 15:35                     ` Russell King - ARM Linux
2015-10-19 16:21                       ` Geert Uytterhoeven
2015-10-19 16:45                         ` Russell King - ARM Linux
2015-10-20 15:46                         ` Alternative approach to solve the deferred probe (was: [GIT PULL] On-demand device probing) Russell King - ARM Linux
2015-10-21  3:58                           ` Alternative approach to solve the deferred probe Frank Rowand
2015-10-21  8:18                             ` Russell King - ARM Linux
2015-10-21 15:36                               ` Frank Rowand
2015-10-21 16:55                                 ` Grygorii Strashko
2015-10-21 17:20                                   ` Russell King - ARM Linux
2015-10-21 18:13                                     ` Grygorii Strashko [this message]
2015-10-21 18:28                                       ` Russell King - ARM Linux
2015-10-22 15:12                                         ` Grygorii Strashko
2015-10-21 18:02                                   ` Frank Rowand
2015-10-21 18:29                                     ` Grygorii Strashko
2015-10-21 20:35                                 ` Russell King - ARM Linux
2015-10-22  0:05                                   ` Frank Rowand
2015-10-22 13:20                           ` Alternative approach to solve the deferred probe (was: [GIT PULL] On-demand device probing) Mark Brown
     [not found]           ` <CAAObsKB2BUZ-smid45wOdAQw6h2yNqCydk+azAFNk69ewHJtZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-21 15:59             ` [GIT PULL] On-demand device probing Frank Rowand
2015-10-21 16:27               ` Mark Brown
2015-10-21 18:18                 ` Frank Rowand
2015-10-21 21:03                   ` Mark Brown
2015-10-21 21:12                   ` Rob Herring
2015-10-21 21:50                     ` Frank Rowand
2015-10-22  9:05                       ` Tomeu Vizoso
2015-10-22 14:38                         ` Greg Kroah-Hartman
2015-10-22 14:44                         ` Greg Kroah-Hartman
     [not found]                           ` <20151022144405.GC21861-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-10-22 15:02                             ` Russell King - ARM Linux
2015-10-22 23:33                               ` Mark Brown
2015-10-22 18:53                           ` Frank Rowand
2015-10-22 19:26                             ` Greg Kroah-Hartman
     [not found]                               ` <20151022192639.GC27248-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-10-23 12:28                                 ` Tomeu Vizoso
     [not found]                             ` <562930AB.1070203-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-23 15:45                               ` Tim Bird
2015-10-23 16:34                                 ` Rob Herring
2015-10-24 14:17                                   ` Rafael J. Wysocki
2015-10-24 22:06                                     ` Mark Brown
2015-10-25 13:54                                       ` Rafael J. Wysocki
2015-10-26  1:12                                         ` Mark Brown
2015-10-26 10:51                                         ` Michael Turquette
2015-10-26 12:55                                           ` Tomeu Vizoso
2015-10-26 23:37                                           ` Rafael J. Wysocki
2015-10-25 19:45                                 ` Andrew F. Davis
2015-10-24 17:55                             ` Geert Uytterhoeven

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=5627D5DC.1040708@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=airlied@linux.ie \
    --cc=broonie@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=frowand.list@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=gnurou@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@ti.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=sre@kernel.org \
    --cc=swarren@wwwdotorg.org \
    --cc=tbergstrom@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=tomeu.vizoso@collabora.com \
    --cc=vinod.koul@intel.com \
    --cc=wsa@the-dreams.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).