public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] driver core: Don't set a deferred probe timeout if modules are disabled
@ 2024-02-27 23:09 Javier Martinez Canillas
  2024-02-28 22:22 ` Andrew Halaney
  2024-03-07 21:39 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2024-02-27 23:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: javier, Andrew Halaney, Javier Martinez Canillas,
	Greg Kroah-Hartman, Rafael J. Wysocki

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-07 23:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-27 23:09 [PATCH v3] driver core: Don't set a deferred probe timeout if modules are disabled Javier Martinez Canillas
2024-02-28 22:22 ` Andrew Halaney
2024-03-07 21:39 ` Greg Kroah-Hartman
2024-03-07 23:20   ` Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox