From: Bart Van Assche <bvanassche@acm.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
driver-core@lists.linux.dev, Bart Van Assche <bvanassche@acm.org>,
Luis Chamberlain <mcgrof@kernel.org>,
Petr Pavlu <petr.pavlu@suse.com>,
Daniel Gomez <da.gomez@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>,
Aaron Tomlin <atomlin@atomlin.com>,
Igor Pylypiv <ipylypiv@google.com>,
Chung-Kai Mei <chungkai@google.com>,
stable@vger.kernel.org
Subject: [PATCH] drivers: base: Set mod->async_probe_requested if needed
Date: Tue, 7 Apr 2026 09:05:11 -0700 [thread overview]
Message-ID: <20260407160511.56289-1-bvanassche@acm.org> (raw)
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) {
reply other threads:[~2026-04-07 16:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260407160511.56289-1-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=atomlin@atomlin.com \
--cc=chungkai@google.com \
--cc=da.gomez@kernel.org \
--cc=dakr@kernel.org \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=ipylypiv@google.com \
--cc=mcgrof@kernel.org \
--cc=petr.pavlu@suse.com \
--cc=rafael@kernel.org \
--cc=samitolvanen@google.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox