* [PATCH] drivers: base: Set mod->async_probe_requested if needed
@ 2026-04-07 16:05 Bart Van Assche
0 siblings, 0 replies; only message in thread
From: Bart Van Assche @ 2026-04-07 16:05 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Rafael J . Wysocki, Danilo Krummrich, driver-core,
Bart Van Assche, Luis Chamberlain, Petr Pavlu, Daniel Gomez,
Sami Tolvanen, Aaron Tomlin, Igor Pylypiv, Chung-Kai Mei, stable
If PROBE_PREFER_ASYNCHRONOUS is set for a device driver, and if loading
other kernel modules depends on probing of that device driver to
complete, e.g. because it is a storage driver, and if
mod->async_probe_requested has not been set, then the
async_synchronize_full() call in do_init_module() introduces a delay.
Fix this by setting mod->async_probe_requested if
PROBE_PREFER_ASYNCHRONOUS has been set. This patch reduces the Pixel 10
boot time by 100 ms.
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Petr Pavlu <petr.pavlu@suse.com>
Cc: Daniel Gomez <da.gomez@kernel.org>
Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Aaron Tomlin <atomlin@atomlin.com>
Cc: Igor Pylypiv <ipylypiv@google.com>
Cc: Chung-Kai Mei <chungkai@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/base/module.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/base/module.c b/drivers/base/module.c
index 218aaa096455..e58fc189d389 100644
--- a/drivers/base/module.c
+++ b/drivers/base/module.c
@@ -39,6 +39,9 @@ int module_add_driver(struct module *mod, const struct device_driver *drv)
if (!drv)
return 0;
+ if (mod && drv->probe_type == PROBE_PREFER_ASYNCHRONOUS)
+ mod->async_probe_requested = true;
+
if (mod)
mk = &mod->mkobj;
else if (drv->mod_name) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-07 16:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 16:05 [PATCH] drivers: base: Set mod->async_probe_requested if needed Bart Van Assche
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox