From: Javier Martinez Canillas <javierm@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: javier@dowhile0.org, Andrew Halaney <ahalaney@redhat.com>,
Javier Martinez Canillas <javierm@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: [PATCH v3] driver core: Don't set a deferred probe timeout if modules are disabled
Date: Wed, 28 Feb 2024 00:09:02 +0100 [thread overview]
Message-ID: <20240227231001.648698-1-javierm@redhat.com> (raw)
There is no point to schedule the workqueue to timeout the deferred probe,
if all the initcalls are done and modules are not enabled. The default for
this case is already 0 but can be overridden by the deferred_probe_timeout
parameter. Let's just skip this and avoid queuing work that is not needed.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
Changes in v3:
- Just skip setting the deferred_probe_timeout parameter when modules
are disabled (Andrew Halaney).
drivers/base/dd.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 85152537dbf1..48a45860d2bb 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -266,6 +266,13 @@ static int __init deferred_probe_timeout_setup(char *str)
{
int timeout;
+ /*
+ * If loadable modules support is disabled, there is no point to
+ * set a timeout for the deferred probe and schedule a workqueue.
+ */
+ if (!IS_ENABLED(CONFIG_MODULES))
+ return 1;
+
if (!kstrtoint(str, 10, &timeout))
driver_deferred_probe_timeout = timeout;
return 1;
--
2.43.2
next reply other threads:[~2024-02-27 23:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 23:09 Javier Martinez Canillas [this message]
2024-02-28 22:22 ` Andrew Halaney
2024-03-07 21:39 ` Greg Kroah-Hartman
2024-03-07 23:20 ` Javier Martinez Canillas
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=20240227231001.648698-1-javierm@redhat.com \
--to=javierm@redhat.com \
--cc=ahalaney@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=javier@dowhile0.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@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
Powered by JetHome