summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@kernel.org>2018-05-10 13:08:40 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-14 16:43:10 +0200
commit84b5c4fec73353a8946fe3f2d43e407d7a53a050 (patch)
treeb8b3b05bac51c9a3161ad681305a9a76be794d2e /drivers/base
parentcf1cde7cd6e42aa65aa7a80e4980afe6d1a1330e (diff)
downloadlinux-stable-84b5c4fec73353a8946fe3f2d43e407d7a53a050.tar.gz
linux-stable-84b5c4fec73353a8946fe3f2d43e407d7a53a050.tar.bz2
linux-stable-84b5c4fec73353a8946fe3f2d43e407d7a53a050.zip
firmware_loader: document firmware_sysfs_fallback()
This also sets the expecations for future fallback interfaces, even if they are not exported. Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/firmware_loader/fallback.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/base/firmware_loader/fallback.c b/drivers/base/firmware_loader/fallback.c
index 3db9e0f225ac..9169e7b9800c 100644
--- a/drivers/base/firmware_loader/fallback.c
+++ b/drivers/base/firmware_loader/fallback.c
@@ -662,6 +662,26 @@ static bool fw_run_sysfs_fallback(enum fw_opt opt_flags)
return fw_force_sysfs_fallback(opt_flags);
}
+/**
+ * firmware_fallback_sysfs() - use the fallback mechanism to find firmware
+ * @fw: pointer to firmware image
+ * @name: name of firmware file to look for
+ * @device: device for which firmware is being loaded
+ * @opt_flags: options to control firmware loading behaviour
+ * @ret: return value from direct lookup which triggered the fallback mechanism
+ *
+ * This function is called if direct lookup for the firmware failed, it enables
+ * a fallback mechanism through userspace by exposing a sysfs loading
+ * interface. Userspace is in charge of loading the firmware through the syfs
+ * loading interface. This syfs fallback mechanism may be disabled completely
+ * on a system by setting the proc sysctl value ignore_sysfs_fallback to true.
+ * If this false we check if the internal API caller set the @FW_OPT_NOFALLBACK
+ * flag, if so it would also disable the fallback mechanism. A system may want
+ * to enfoce the sysfs fallback mechanism at all times, it can do this by
+ * setting ignore_sysfs_fallback to false and force_sysfs_fallback to true.
+ * Enabling force_sysfs_fallback is functionally equivalent to build a kernel
+ * with CONFIG_FW_LOADER_USER_HELPER_FALLBACK.
+ **/
int firmware_fallback_sysfs(struct firmware *fw, const char *name,
struct device *device,
enum fw_opt opt_flags,