Skip to content

Commit 85db1cd

Browse files
jwrdegoedegregkh
authored andcommitted
firmware: Rename FW_OPT_NOFALLBACK to FW_OPT_NOFALLBACK_SYSFS
This is a preparation patch for adding a new platform fallback mechanism, which will have its own enable/disable FW_OPT_xxx option. Note this also fixes a typo in one of the re-wordwrapped comments: enfoce -> enforce. Acked-by: Luis Chamberlain <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 72a9cc9 commit 85db1cd

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

drivers/base/firmware_loader/fallback.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ static bool fw_run_sysfs_fallback(enum fw_opt opt_flags)
606606
return false;
607607
}
608608

609-
if ((opt_flags & FW_OPT_NOFALLBACK))
609+
if ((opt_flags & FW_OPT_NOFALLBACK_SYSFS))
610610
return false;
611611

612612
/* Also permit LSMs and IMA to fail firmware sysfs fallback */
@@ -630,10 +630,11 @@ static bool fw_run_sysfs_fallback(enum fw_opt opt_flags)
630630
* interface. Userspace is in charge of loading the firmware through the sysfs
631631
* loading interface. This sysfs fallback mechanism may be disabled completely
632632
* on a system by setting the proc sysctl value ignore_sysfs_fallback to true.
633-
* If this false we check if the internal API caller set the @FW_OPT_NOFALLBACK
634-
* flag, if so it would also disable the fallback mechanism. A system may want
635-
* to enfoce the sysfs fallback mechanism at all times, it can do this by
636-
* setting ignore_sysfs_fallback to false and force_sysfs_fallback to true.
633+
* If this is false we check if the internal API caller set the
634+
* @FW_OPT_NOFALLBACK_SYSFS flag, if so it would also disable the fallback
635+
* mechanism. A system may want to enforce the sysfs fallback mechanism at all
636+
* times, it can do this by setting ignore_sysfs_fallback to false and
637+
* force_sysfs_fallback to true.
637638
* Enabling force_sysfs_fallback is functionally equivalent to build a kernel
638639
* with CONFIG_FW_LOADER_USER_HELPER_FALLBACK.
639640
**/

drivers/base/firmware_loader/firmware.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
* firmware file lookup on storage is avoided. Used for calls where the
2828
* file may be too big, or where the driver takes charge of its own
2929
* firmware caching mechanism.
30-
* @FW_OPT_NOFALLBACK: Disable the fallback mechanism. Takes precedence over
31-
* &FW_OPT_UEVENT and &FW_OPT_USERHELPER.
30+
* @FW_OPT_NOFALLBACK_SYSFS: Disable the sysfs fallback mechanism. Takes
31+
* precedence over &FW_OPT_UEVENT and &FW_OPT_USERHELPER.
3232
*/
3333
enum fw_opt {
34-
FW_OPT_UEVENT = BIT(0),
35-
FW_OPT_NOWAIT = BIT(1),
36-
FW_OPT_USERHELPER = BIT(2),
37-
FW_OPT_NO_WARN = BIT(3),
38-
FW_OPT_NOCACHE = BIT(4),
39-
FW_OPT_NOFALLBACK = BIT(5),
34+
FW_OPT_UEVENT = BIT(0),
35+
FW_OPT_NOWAIT = BIT(1),
36+
FW_OPT_USERHELPER = BIT(2),
37+
FW_OPT_NO_WARN = BIT(3),
38+
FW_OPT_NOCACHE = BIT(4),
39+
FW_OPT_NOFALLBACK_SYSFS = BIT(5),
4040
};
4141

4242
enum fw_status {

drivers/base/firmware_loader/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ int request_firmware_direct(const struct firmware **firmware_p,
877877
__module_get(THIS_MODULE);
878878
ret = _request_firmware(firmware_p, name, device, NULL, 0,
879879
FW_OPT_UEVENT | FW_OPT_NO_WARN |
880-
FW_OPT_NOFALLBACK);
880+
FW_OPT_NOFALLBACK_SYSFS);
881881
module_put(THIS_MODULE);
882882
return ret;
883883
}

0 commit comments

Comments
 (0)