* [PATCH] driver core: Make deferred_probe_timeout default a Kconfig option
@ 2026-02-12 13:46 Hans de Goede
2026-02-12 14:10 ` Hans de Goede
2026-02-12 14:30 ` bluez.test.bot
0 siblings, 2 replies; 3+ messages in thread
From: Hans de Goede @ 2026-02-12 13:46 UTC (permalink / raw)
To: Bartosz Golaszewski, Marcel Holtmann, Luiz Augusto von Dentz
Cc: Hans de Goede, linux-arm-msm, linux-bluetooth
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 and allow using a value of -1 to disable the timeout
(wait indefinitely).
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
Documentation/admin-guide/kernel-parameters.txt | 2 +-
drivers/base/Kconfig | 9 +++++++++
drivers/base/dd.c | 9 ++++-----
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 1058f2a6d6a8..80d300c4e16b 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1250,7 +1250,7 @@ Kernel parameters
out hasn't expired, it'll be restarted by each
successful driver registration. This option will also
dump out devices still on the deferred probe list after
- retrying.
+ retrying. Set to -1 to wait indefinitely.
delayacct [KNL] Enable per-task delay accounting
diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index 1786d87b29e2..f7d385cbd3ba 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -73,6 +73,15 @@ config DEVTMPFS_SAFE
with the PROT_EXEC flag. This can break, for example, non-KMS
video drivers.
+config DRIVER_DEFERRED_PROBE_TIMEOUT
+ int "Default value for deferred_probe_timeout"
+ default 0 if !MODULES
+ default 10 if MODULES
+ help
+ Set the default value for the deferred_probe_timeout kernel parameter.
+ See Documentation/admin-guide/kernel-parameters.txt for a description
+ of the deferred_probe_timeout kernel parameter.
+
config STANDALONE
bool "Select only drivers that don't need compile-time external firmware"
default y
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index bea8da5f8a3a..e57144aa168d 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -257,11 +257,7 @@ static int deferred_devs_show(struct seq_file *s, void *data)
}
DEFINE_SHOW_ATTRIBUTE(deferred_devs);
-#ifdef CONFIG_MODULES
-static int driver_deferred_probe_timeout = 10;
-#else
-static int driver_deferred_probe_timeout;
-#endif
+static int driver_deferred_probe_timeout = CONFIG_DRIVER_DEFERRED_PROBE_TIMEOUT;
static int __init deferred_probe_timeout_setup(char *str)
{
@@ -323,6 +319,9 @@ static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_
void deferred_probe_extend_timeout(void)
{
+ if (driver_deferred_probe_timeout < 0)
+ return;
+
/*
* If the work hasn't been queued yet or if the work expired, don't
* start a new one.
--
2.52.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] driver core: Make deferred_probe_timeout default a Kconfig option
2026-02-12 13:46 [PATCH] driver core: Make deferred_probe_timeout default a Kconfig option Hans de Goede
@ 2026-02-12 14:10 ` Hans de Goede
2026-02-12 14:30 ` bluez.test.bot
1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2026-02-12 14:10 UTC (permalink / raw)
To: Bartosz Golaszewski, Marcel Holtmann, Luiz Augusto von Dentz
Cc: linux-arm-msm, linux-bluetooth
Hi,
On 12-Feb-26 14:46, Hans de Goede wrote:
> 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 and allow using a value of -1 to disable the timeout
> (wait indefinitely).
>
> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
I made a mistake and accidentally resend this old patch instead
of the patches which I actually tried to send. Please ignore.
Sorry for the noise.
Regards,
Hans
> ---
> Documentation/admin-guide/kernel-parameters.txt | 2 +-
> drivers/base/Kconfig | 9 +++++++++
> drivers/base/dd.c | 9 ++++-----
> 3 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 1058f2a6d6a8..80d300c4e16b 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -1250,7 +1250,7 @@ Kernel parameters
> out hasn't expired, it'll be restarted by each
> successful driver registration. This option will also
> dump out devices still on the deferred probe list after
> - retrying.
> + retrying. Set to -1 to wait indefinitely.
>
> delayacct [KNL] Enable per-task delay accounting
>
> diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
> index 1786d87b29e2..f7d385cbd3ba 100644
> --- a/drivers/base/Kconfig
> +++ b/drivers/base/Kconfig
> @@ -73,6 +73,15 @@ config DEVTMPFS_SAFE
> with the PROT_EXEC flag. This can break, for example, non-KMS
> video drivers.
>
> +config DRIVER_DEFERRED_PROBE_TIMEOUT
> + int "Default value for deferred_probe_timeout"
> + default 0 if !MODULES
> + default 10 if MODULES
> + help
> + Set the default value for the deferred_probe_timeout kernel parameter.
> + See Documentation/admin-guide/kernel-parameters.txt for a description
> + of the deferred_probe_timeout kernel parameter.
> +
> config STANDALONE
> bool "Select only drivers that don't need compile-time external firmware"
> default y
> diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> index bea8da5f8a3a..e57144aa168d 100644
> --- a/drivers/base/dd.c
> +++ b/drivers/base/dd.c
> @@ -257,11 +257,7 @@ static int deferred_devs_show(struct seq_file *s, void *data)
> }
> DEFINE_SHOW_ATTRIBUTE(deferred_devs);
>
> -#ifdef CONFIG_MODULES
> -static int driver_deferred_probe_timeout = 10;
> -#else
> -static int driver_deferred_probe_timeout;
> -#endif
> +static int driver_deferred_probe_timeout = CONFIG_DRIVER_DEFERRED_PROBE_TIMEOUT;
>
> static int __init deferred_probe_timeout_setup(char *str)
> {
> @@ -323,6 +319,9 @@ static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_
>
> void deferred_probe_extend_timeout(void)
> {
> + if (driver_deferred_probe_timeout < 0)
> + return;
> +
> /*
> * If the work hasn't been queued yet or if the work expired, don't
> * start a new one.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: driver core: Make deferred_probe_timeout default a Kconfig option
2026-02-12 13:46 [PATCH] driver core: Make deferred_probe_timeout default a Kconfig option Hans de Goede
2026-02-12 14:10 ` Hans de Goede
@ 2026-02-12 14:30 ` bluez.test.bot
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-02-12 14:30 UTC (permalink / raw)
To: linux-bluetooth, johannes.goede
[-- Attachment #1: Type: text/plain, Size: 2760 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1053567
---Test result---
Test Summary:
CheckPatch PENDING 0.35 seconds
GitLint PENDING 0.34 seconds
SubjectPrefix FAIL 0.46 seconds
BuildKernel PASS 25.89 seconds
CheckAllWarning PASS 28.03 seconds
CheckSparse PASS 31.97 seconds
BuildKernel32 PASS 25.10 seconds
TestRunnerSetup PASS 560.28 seconds
TestRunner_l2cap-tester PASS 28.86 seconds
TestRunner_iso-tester PASS 83.77 seconds
TestRunner_bnep-tester PASS 6.36 seconds
TestRunner_mgmt-tester FAIL 122.93 seconds
TestRunner_rfcomm-tester PASS 9.59 seconds
TestRunner_sco-tester FAIL 14.75 seconds
TestRunner_ioctl-tester PASS 10.36 seconds
TestRunner_mesh-tester FAIL 12.50 seconds
TestRunner_smp-tester PASS 8.87 seconds
TestRunner_userchan-tester PASS 9.30 seconds
IncrementalBuild PENDING 0.54 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4
Failed Test Cases
Read Exp Feature - Success Failed 0.113 seconds
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
WARNING: possible circular locking dependency detected
BUG: sleeping function called from invalid context at net/core/sock.c:3782
Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0
Failed Test Cases
Mesh - Send cancel - 1 Timed out 2.515 seconds
Mesh - Send cancel - 2 Timed out 1.999 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-12 14:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-12 13:46 [PATCH] driver core: Make deferred_probe_timeout default a Kconfig option Hans de Goede
2026-02-12 14:10 ` Hans de Goede
2026-02-12 14:30 ` bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox