Skip to content

Commit ce68929

Browse files
johnstultz-workgregkh
authored andcommitted
driver core: Revert default driver_deferred_probe_timeout value to 0
This patch addresses a regression in 5.7-rc1+ In commit c8c43ce ("driver core: Fix driver_deferred_probe_check_state() logic"), we both cleaned up the logic and also set the default driver_deferred_probe_timeout value to 30 seconds to allow for drivers that are missing dependencies to have some time so that the dependency may be loaded from userland after initcalls_done is set. However, Yoshihiro Shimoda reported that on his device that expects to have unmet dependencies (due to "optional links" in its devicetree), was failing to mount the NFS root. In digging further, it seemed the problem was that while the device properly probes after waiting 30 seconds for any missing modules to load, the ip_auto_config() had already failed, resulting in NFS to fail. This was due to ip_auto_config() calling wait_for_device_probe() which doesn't wait for the driver_deferred_probe_timeout to fire. Fixing that issue is possible, but could also introduce 30 second delays in bootups for users who don't have any missing dependencies, which is not ideal. So I think the best solution to avoid any regressions is to revert back to a default timeout value of zero, and allow systems that need to utilize the timeout in order for userland to load any modules that supply misisng dependencies in the dts to specify the timeout length via the exiting documented boot argument. Thanks to Geert for chasing down that ip_auto_config was why NFS was failing in this case! Cc: "David S. Miller" <[email protected]> Cc: Alexey Kuznetsov <[email protected]> Cc: Hideaki YOSHIFUJI <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Rob Herring <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Yoshihiro Shimoda <[email protected]> Cc: Robin Murphy <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Sudeep Holla <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Naresh Kamboju <[email protected]> Cc: Basil Eljuse <[email protected]> Cc: Ferry Toth <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Anders Roxell <[email protected]> Reported-by: Yoshihiro Shimoda <[email protected]> Tested-by: Yoshihiro Shimoda <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Fixes: c8c43ce ("driver core: Fix driver_deferred_probe_check_state() logic") Signed-off-by: John Stultz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7706b0a commit ce68929

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

drivers/base/dd.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,7 @@ static int deferred_devs_show(struct seq_file *s, void *data)
224224
}
225225
DEFINE_SHOW_ATTRIBUTE(deferred_devs);
226226

227-
#ifdef CONFIG_MODULES
228-
/*
229-
* In the case of modules, set the default probe timeout to
230-
* 30 seconds to give userland some time to load needed modules
231-
*/
232-
int driver_deferred_probe_timeout = 30;
233-
#else
234-
/* In the case of !modules, no probe timeout needed */
235-
int driver_deferred_probe_timeout = -1;
236-
#endif
227+
int driver_deferred_probe_timeout;
237228
EXPORT_SYMBOL_GPL(driver_deferred_probe_timeout);
238229

239230
static int __init deferred_probe_timeout_setup(char *str)
@@ -266,7 +257,7 @@ int driver_deferred_probe_check_state(struct device *dev)
266257
return -ENODEV;
267258
}
268259

269-
if (!driver_deferred_probe_timeout) {
260+
if (!driver_deferred_probe_timeout && initcalls_done) {
270261
dev_WARN(dev, "deferred probe timeout, ignoring dependency");
271262
return -ETIMEDOUT;
272263
}

0 commit comments

Comments
 (0)