summaryrefslogtreecommitdiff
path: root/drivers/base/firmware_loader/sysfs.c
diff options
context:
space:
mode:
authorRuss Weight <russell.h.weight@intel.com>2022-04-22 00:22:01 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-26 13:35:55 +0300
commit536fd8184b7dfa30e28e5b459e7c5c91c3a8063f (patch)
treec12a1f13db4d208578d753fa21f70dd371152059 /drivers/base/firmware_loader/sysfs.c
parent97730bbb242cde22b7140acd202ffd88823886c9 (diff)
downloadlinux-536fd8184b7dfa30e28e5b459e7c5c91c3a8063f.tar.xz
firmware_loader: Add sysfs nodes to monitor fw_upload
Add additional sysfs nodes to monitor the transfer of firmware upload data to the target device: cancel: Write 1 to cancel the data transfer error: Display error status for a failed firmware upload remaining_size: Display the remaining amount of data to be transferred status: Display the progress of the firmware upload Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Reviewed-by: Tianfei zhang <tianfei.zhang@intel.com> Tested-by: Matthew Gerlach <matthew.gerlach@linux.intel.com> Signed-off-by: Russ Weight <russell.h.weight@intel.com> Link: https://lore.kernel.org/r/20220421212204.36052-6-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_loader/sysfs.c')
-rw-r--r--drivers/base/firmware_loader/sysfs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/base/firmware_loader/sysfs.c b/drivers/base/firmware_loader/sysfs.c
index 4a956cc3b7ea..c09fcebeada9 100644
--- a/drivers/base/firmware_loader/sysfs.c
+++ b/drivers/base/firmware_loader/sysfs.c
@@ -371,6 +371,12 @@ static struct bin_attribute firmware_attr_data = {
static struct attribute *fw_dev_attrs[] = {
&dev_attr_loading.attr,
+#ifdef CONFIG_FW_UPLOAD
+ &dev_attr_cancel.attr,
+ &dev_attr_status.attr,
+ &dev_attr_error.attr,
+ &dev_attr_remaining_size.attr,
+#endif
NULL
};
@@ -382,6 +388,9 @@ static struct bin_attribute *fw_dev_bin_attrs[] = {
static const struct attribute_group fw_dev_attr_group = {
.attrs = fw_dev_attrs,
.bin_attrs = fw_dev_bin_attrs,
+#ifdef CONFIG_FW_UPLOAD
+ .is_visible = fw_upload_is_visible,
+#endif
};
static const struct attribute_group *fw_dev_attr_groups[] = {