Skip to content

Commit 56e3ee7

Browse files
Hans de GoedeDanilo Krummrich
authored andcommitted
driver core: Make deferred_probe_timeout default a Kconfig option
Code using driver_deferred_probe_check_state() differs from most EPROBE_DEFER handling in the kernel. Where other EPROBE_DEFER handling (e.g. clks, gpios and regulators) waits indefinitely for suppliers to show up, code using driver_deferred_probe_check_state() will fail after the deferred_probe_timeout. This is a problem for generic distro kernels which want to support many boards using a single kernel build. These kernels want as much drivers to be modular as possible. The initrd also should be as small as possible, so the initrd will *not* have drivers not needing to get the rootfs. Combine this with waiting for a full-disk encryption password in the initrd and it is pretty much guaranteed that the default 10s timeout will be hit, causing probe() failures when drivers on the rootfs happen to get modprobe-d before other rootfs modules providing their suppliers. Make the default timeout configurable from Kconfig to allow distro kernel configs where many of the supplier drivers are modules to set the default through Kconfig. Reviewed-by: Saravana Kannan <saravanak@kernel.org> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Link: https://patch.msgid.link/20260314084916.10868-1-johannes.goede@oss.qualcomm.com [ Drop deferred_probe_timeout documentation change in kernel-parameters.txt. - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
1 parent 3210dab commit 56e3ee7

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

drivers/base/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ config DEVTMPFS_SAFE
7373
with the PROT_EXEC flag. This can break, for example, non-KMS
7474
video drivers.
7575

76+
config DRIVER_DEFERRED_PROBE_TIMEOUT
77+
int "Default value for deferred_probe_timeout"
78+
default 0 if !MODULES
79+
default 10 if MODULES
80+
help
81+
Set the default value for the deferred_probe_timeout kernel parameter.
82+
See Documentation/admin-guide/kernel-parameters.txt for a description
83+
of the deferred_probe_timeout kernel parameter.
84+
7685
config STANDALONE
7786
bool "Select only drivers that don't need compile-time external firmware"
7887
default y

drivers/base/dd.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,7 @@ static int deferred_devs_show(struct seq_file *s, void *data)
257257
}
258258
DEFINE_SHOW_ATTRIBUTE(deferred_devs);
259259

260-
#ifdef CONFIG_MODULES
261-
static int driver_deferred_probe_timeout = 10;
262-
#else
263-
static int driver_deferred_probe_timeout;
264-
#endif
260+
static int driver_deferred_probe_timeout = CONFIG_DRIVER_DEFERRED_PROBE_TIMEOUT;
265261

266262
static int __init deferred_probe_timeout_setup(char *str)
267263
{

0 commit comments

Comments
 (0)