[lkml]   [2020]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[RFC][PATCH] driver core: Extend returning EPROBE_DEFER for two minutes after late_initcall
Due to commit e01afc3250255 ("PM / Domains: Stop deferring probe
at the end of initcall"), along with commit 25b4e70dcce9
("driver core: allow stopping deferred probe after init") after
late_initcall, drivers will stop getting EPROBE_DEFER, and
instead see an error causing the driver to fail to load.

That change causes trouble when trying to use many clk drivers
as modules, as the clk modules may not load until much later
after init has started. If a dependent driver loads and gets an
error instead of EPROBE_DEFER, it won't try to reload later when
the dependency is met, and will thus fail to load.

Instead of reverting that patch, this patch tries to extend the
time that EPROBE_DEFER is retruned by two minutes, to (hopefully)
ensure that everything has had a chance to load.

Specifically, on db845c, this change allows us to set
get a working system, where as without it the display will fail
to load.

Cc: Alexander Graf <>
Cc: Rob Herring <>
Cc: "Rafael J. Wysocki" <>
Cc: Kevin Hilman <>
Cc: Ulf Hansson <>
Cc: Pavel Machek <>
Cc: Len Brown <>
Cc: Todd Kjos <>
Cc: Bjorn Andersson <>
Cc: Greg Kroah-Hartman <>
Fixes: e01afc3250255 ("PM / Domains: Stop deferring probe at the end of initcall")
Fixes: 25b4e70dcce9 ("driver core: allow stopping deferred probe after init")
Signed-off-by: John Stultz <>
drivers/base/dd.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index b25bcab2a26b..35ebae8b65be 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -311,6 +311,12 @@ static void deferred_probe_timeout_work_func(struct work_struct *work)
static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_work_func);

+static void deferred_initcall_done_work_func(struct work_struct *work)
+ initcalls_done = true;
+static DECLARE_DELAYED_WORK(deferred_initcall_done_work, deferred_initcall_done_work_func);
* deferred_probe_initcall() - Enable probing of deferred devices
@@ -327,7 +333,7 @@ static int deferred_probe_initcall(void)
/* Sort as many dependencies as possible before exiting initcalls */
- initcalls_done = true;
+ schedule_delayed_work(&deferred_initcall_done_work, 120 * HZ);

* Trigger deferred probe again, this time we won't defer anything
 \ /
  Last update: 2020-02-14 01:45    [W:0.956 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site