forked from deepin-community/kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platform/x86: think-lmi: Add bulk save feature
On Lenovo platforms there is a limitation in the number of times an attribute can be saved. This is an architectural limitation and it limits the number of attributes that can be modified to 48. A solution for this is instead of the attribute being saved after every modification allow a user to bulk set the attributes and then trigger a final save. This allows unlimited attributes. This patch introduces a save_settings attribute that can be configured to either single or bulk mode by the user. Single mode is the default but customers who want to avoid the 48 attribute limit can enable bulk mode. Displaying the save_settings attribute will display the enabled mode. When in bulk mode writing 'save' to the save_settings attribute will trigger a save. Once this has been done a reboot is required before more attributes can be modified. Signed-off-by: Mark Pearson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
- Loading branch information
1 parent
423c336
commit 318d978
Showing
3 changed files
with
183 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -383,6 +383,36 @@ Description: | |
Note that any changes to this attribute requires a reboot | ||
for changes to take effect. | ||
|
||
What: /sys/class/firmware-attributes/*/attributes/save_settings | ||
Date: August 2023 | ||
KernelVersion: 6.6 | ||
Contact: Mark Pearson <[email protected]> | ||
Description: | ||
On Lenovo platforms there is a limitation in the number of times an attribute can be | ||
saved. This is an architectural limitation and it limits the number of attributes | ||
that can be modified to 48. | ||
A solution for this is instead of the attribute being saved after every modification, | ||
to allow a user to bulk set the attributes, and then trigger a final save. This allows | ||
unlimited attributes. | ||
|
||
Read the attribute to check what save mode is enabled (single or bulk). | ||
E.g: | ||
# cat /sys/class/firmware-attributes/thinklmi/attributes/save_settings | ||
single | ||
|
||
Write the attribute with 'bulk' to enable bulk save mode. | ||
Write the attribute with 'single' to enable saving, after every attribute set. | ||
The default setting is single mode. | ||
E.g: | ||
# echo bulk > /sys/class/firmware-attributes/thinklmi/attributes/save_settings | ||
|
||
When in bulk mode write 'save' to trigger a save of all currently modified attributes. | ||
Note, once a save has been triggered, in bulk mode, attributes can no longer be set and | ||
will return a permissions error. This is to prevent users hitting the 48+ save limitation | ||
(which requires entering the BIOS to clear the error condition) | ||
E.g: | ||
# echo save > /sys/class/firmware-attributes/thinklmi/attributes/save_settings | ||
|
||
What: /sys/class/firmware-attributes/*/attributes/debug_cmd | ||
Date: July 2021 | ||
KernelVersion: 5.14 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters