From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Javier Martinez Canillas <javierm@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Saravana Kannan <saravanak@google.com>,
Peter Robinson <pbrobinson@redhat.com>,
Steev Klimaszewski <steev@kali.org>,
Rob Herring <robh@kernel.org>,
Sergio Lopez Pascual <slp@redhat.com>,
Enric Balletbo i Serra <eballetbo@redhat.com>,
John Stultz <jstultz@google.com>,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH] driver core: Disable driver deferred probe timeout by default
Date: Mon, 14 Nov 2022 11:54:08 +0100 [thread overview]
Message-ID: <Y3IeUADalX6WDnuO@kroah.com> (raw)
In-Reply-To: <20221114104333.3695531-1-javierm@redhat.com>
On Mon, Nov 14, 2022 at 11:43:33AM +0100, Javier Martinez Canillas wrote:
> The driver_deferred_probe_timeout value has a long story. It was first set
> to -1 when it was introduced by commit 25b4e70dcce9 ("driver core: allow
> stopping deferred probe after init"), meaning that the driver core would
> defer the probe forever unless a subsystem would opt-in by checking if the
> initcalls where done using the driver_deferred_probe_check_state() helper,
> or if a timeout was explicitly set with a "deferred_probe_timeout" param.
>
> Only the power domain, IOMMU and MDIO subsystems currently opt-in to check
> if the initcalls have completed with driver_deferred_probe_check_state().
>
> Commit c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state()
> logic") then changed the driver_deferred_probe_check_state() helper logic,
> to take into account whether modules have been enabled or not and also to
> return -EPROBE_DEFER if the probe deferred timeout was still running.
>
> Then in commit e2cec7d68537 ("driver core: Set deferred_probe_timeout to a
> longer default if CONFIG_MODULES is set"), the timeout was increased to 30
> seconds if modules are enabled. Because seems that some of the subsystems
> that were opt-in to not return -EPROBE_DEFER after the initcall where done
> could still have dependencies whose drivers were built as a module.
>
> This commit did a fundamental change to how probe deferral worked though,
> since now the default was not to attempt probing for drivers indefinitely
> but instead it would timeout after 30 seconds unless a different timeout
> was set using the "deferred_probe_timeout" parameter.
>
> The behavior was changed even mere with commit ce68929f07de ("driver core:
> Revert default driver_deferred_probe_timeout value to 0"), since the value
> was set to 0 by default. Meaning that the probe deferral would be disabled
> after the initcalls where done. Unless a timeout was set in the cmdline.
>
> Notice that the commit said that it was reverting the default value to 0,
> but this was never 0. The default was -1 at the beginning and then changed
> to 30 in a later commit.
>
> This default value of 0 was reverted again by commit f516d01b9df2 ("Revert
> "driver core: Set default deferred_probe_timeout back to 0."") and set to
> 10 seconds instead. Which was still less than the 30 seconds that was set
> at some point to allow systems with drivers built as modules and loaded by
> user-land to probe drivers that were previously deferred.
>
> The 10 seconds timeout isn't enough for the mentioned systems, for example
> general purpose distributions attempt to build all the possible drivers as
> a module to keep the Linux kernel image small. But that means that in very
> likely that the probe deferral mechanism will timeout and drivers won't be
> probed correctly.
What specific "mentioned systems" have deferred probe drivers that are
failing on the current value? What drivers are causing the long delay
here? No one should be having to wait 10 seconds for a deferred delay
on a real system as that feels really wrong.
Why not fix the drivers that are causing this delay and maybe move them
to be async so as to not slow down the whole boot process?
thanks,
greg k-h
next prev parent reply other threads:[~2022-11-14 10:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 10:43 [PATCH] driver core: Disable driver deferred probe timeout by default Javier Martinez Canillas
2022-11-14 10:54 ` Greg Kroah-Hartman [this message]
2022-11-14 11:13 ` Javier Martinez Canillas
2022-11-14 11:38 ` Greg Kroah-Hartman
2022-11-14 11:56 ` Javier Martinez Canillas
2022-11-14 16:20 ` Steev Klimaszewski
2022-11-15 9:33 ` John Stultz
2022-11-15 10:52 ` Javier Martinez Canillas
2022-11-16 20:49 ` John Stultz
2022-11-17 8:14 ` Javier Martinez Canillas
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=Y3IeUADalX6WDnuO@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=eballetbo@redhat.com \
--cc=javierm@redhat.com \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbrobinson@redhat.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=slp@redhat.com \
--cc=steev@kali.org \
/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