From: Saravana Kannan <saravanak@google.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>,
kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: [PATCH v1] driver core: Ignore driver_async_probe cmdline param for module drivers
Date: Wed, 22 Jun 2022 21:21:50 -0700 [thread overview]
Message-ID: <20220623042150.762330-1-saravanak@google.com> (raw)
If the module's async_probe option isn't set, the module loading code
will do a async_synchronize_full() before returning to userspace. This
effectively negates any benefits of driver_async_probe listing the
module's driver.
If the module's async_probe is set, then we already do async probe for
that module's driver even if driver_async_probe does not list that
driver. So, again, the driver_async_probe's value doesn't matter for a
module's driver.
So this change ignores the driver_async_probe for module drivers to
avoid useless async probes.
In addition, if driver_async_probe lists a module's driver and the
driver's async probe ends up calling request_module() in the async
thread context, that's going to trigger a spurious WARNING stack dump
without any real benefits of async probing. So this will avoid that
unnecessary warning in that situation.
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
drivers/base/dd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index e600dd2afc35..f1ac28a4ce62 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -823,7 +823,7 @@ bool driver_allows_async_probing(struct device_driver *drv)
return false;
default:
- if (cmdline_requested_async_probing(drv->name))
+ if (cmdline_requested_async_probing(drv->name) && drv->owner == NULL)
return true;
if (module_requested_async_probing(drv->owner))
--
2.37.0.rc0.161.g10f37bed90-goog
next reply other threads:[~2022-06-23 4:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 4:21 Saravana Kannan [this message]
2022-06-23 9:08 ` Greg Kroah-Hartman
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=20220623042150.762330-1-saravanak@google.com \
--to=saravanak@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@android.com \
--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
all inboxes | Powered by JetHome®