summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorSaravana Kannan <saravanak@google.com>2021-02-06 01:26:39 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-09 16:31:06 +0300
commit19d0f5f6bff878277783fd98fef4ae2441d6a1d8 (patch)
treee866cd2ca0df5ead38fdbbc6ec6188755cc33218 /drivers/base
parent1753c4d1edbcf1b35e585ff76777d09434344c8f (diff)
downloadlinux-19d0f5f6bff878277783fd98fef4ae2441d6a1d8.tar.xz
driver core: Add fw_devlink.strict kernel param
This param allows forcing all dependencies to be treated as mandatory. This will be useful for boards in which all optional dependencies like IOMMUs and DMAs need to be treated as mandatory dependencies. Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Saravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20210205222644.2357303-4-saravanak@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index c95b1daabac7..f466ab4f1c35 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1521,6 +1521,13 @@ static int __init fw_devlink_setup(char *arg)
}
early_param("fw_devlink", fw_devlink_setup);
+static bool fw_devlink_strict;
+static int __init fw_devlink_strict_setup(char *arg)
+{
+ return strtobool(arg, &fw_devlink_strict);
+}
+early_param("fw_devlink.strict", fw_devlink_strict_setup);
+
u32 fw_devlink_get_flags(void)
{
return fw_devlink_flags;
@@ -1531,6 +1538,11 @@ static bool fw_devlink_is_permissive(void)
return fw_devlink_flags == FW_DEVLINK_FLAGS_PERMISSIVE;
}
+bool fw_devlink_is_strict(void)
+{
+ return fw_devlink_strict && !fw_devlink_is_permissive();
+}
+
static void fw_devlink_parse_fwnode(struct fwnode_handle *fwnode)
{
if (fwnode->flags & FWNODE_FLAG_LINKS_ADDED)