summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSaravana Kannan <saravanak@google.com>2022-06-03 18:01:00 -0700
committerLuis Chamberlain <mcgrof@kernel.org>2022-07-11 10:49:14 -0700
commitae39e9ed964f8e450d0de410b5a757e19581dfc5 (patch)
tree1d88893e7c2f7c6ee348bc2df20c7aa459c12d49 /kernel
parente69a66147d49506062cd837f3b230ee3e98102ab (diff)
downloadlinux-ae39e9ed964f8e450d0de410b5a757e19581dfc5.tar.gz
linux-ae39e9ed964f8e450d0de410b5a757e19581dfc5.tar.bz2
linux-ae39e9ed964f8e450d0de410b5a757e19581dfc5.zip
module: Add support for default value for module async_probe
Add a module.async_probe kernel command line option that allows enabling async probing for all modules. When this command line option is used, there might still be some modules for which we want to explicitly force synchronous probing, so extend <modulename>.async_probe to take an optional bool input so that async probing can be disabled for a specific module. Signed-off-by: Saravana Kannan <saravanak@google.com> Reviewed-by: Aaron Tomlin <atomlin@redhat.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/module/main.c b/kernel/module/main.c
index 0548151dd933..07dd9c293ab9 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -2410,6 +2410,12 @@ static void do_free_init(struct work_struct *w)
}
}
+#undef MODULE_PARAM_PREFIX
+#define MODULE_PARAM_PREFIX "module."
+/* Default value for module->async_probe_requested */
+static bool async_probe;
+module_param(async_probe, bool, 0644);
+
/*
* This is where the real work happens.
*
@@ -2630,7 +2636,8 @@ static int unknown_module_param_cb(char *param, char *val, const char *modname,
int ret;
if (strcmp(param, "async_probe") == 0) {
- mod->async_probe_requested = true;
+ if (strtobool(val, &mod->async_probe_requested))
+ mod->async_probe_requested = true;
return 0;
}
@@ -2797,6 +2804,8 @@ static int load_module(struct load_info *info, const char __user *uargs,
if (err)
goto bug_cleanup;
+ mod->async_probe_requested = async_probe;
+
/* Module is ready to execute: parsing args may do that. */
after_dashes = parse_args(mod->name, mod->args, mod->kp, mod->num_kp,
-32768, 32767, mod,