Skip to contentSkip to conversation

scsi: ufs: sysfs: Make HID attributes visible

PATCH Applied Daniel Lee 3 participants 4 messages Sep 30, 2025 – Oct 7, 2025

Subsystems (2)
lore
Share & tools
lore

Daniel Lee

author
#0 lore raw

PATCH 1/1 scsi: ufs: sysfs: Make HID attributes visible

Call sysfs_update_group() after reading the device descriptor to ensure the HID sysfs attributes are visible when the feature is supported.

Fixes ae7795a8c258 ("scsi: ufs: core: Add HID support")
---
 drivers/ufs/core/ufs-sysfs.c | 2 +-
 drivers/ufs/core/ufs-sysfs.h | 1 +
 drivers/ufs/core/ufshcd.c    | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)
drivers/ufs/core/ufs-sysfs.c +1 -1
index 0086816b27cd..c040afc6668e 100644
@@ -1949,7 +1949,7 @@ static umode_t ufs_sysfs_hid_is_visible(struct kobject *kobj,
 	return	hba->dev_info.hid_sup ? attr->mode : 0;
 }
 
-static const struct attribute_group ufs_sysfs_hid_group = {
+const struct attribute_group ufs_sysfs_hid_group = {
 	.name = "hid",
 	.attrs = ufs_sysfs_hid,
 	.is_visible = ufs_sysfs_hid_is_visible,
drivers/ufs/core/ufs-sysfs.h +1 -0
index 8d94af3b8077..6efb82a082fd 100644
@@ -14,5 +14,6 @@ void ufs_sysfs_remove_nodes(struct device *dev);
 
 extern const struct attribute_group ufs_sysfs_unit_descriptor_group;
 extern const struct attribute_group ufs_sysfs_lun_attributes_group;
+extern const struct attribute_group ufs_sysfs_hid_group;
 
 #endif
drivers/ufs/core/ufshcd.c +2 -0
index b2e103aa4e62..bace5112e095 100644
@@ -8472,6 +8472,8 @@ static int ufs_get_device_desc(struct ufs_hba *hba)
 				DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP) &
 				UFS_DEV_HID_SUPPORT;
 
+	sysfs_update_group(&hba->dev->kobj, &ufs_sysfs_hid_group);
+
 	model_index = desc_buf[DEVICE_DESC_PARAM_PRDCT_NAME];
 
 	err = ufshcd_read_string_desc(hba, model_index,
Signature · 1 line
2.51.0.618.g983fd99d29-goog
#2 lore raw
In reply to Daniel Lee

Daniel,

Quoted 3 lines

Call sysfs_update_group() after reading the device descriptor to ensure the HID sysfs attributes are visible when the feature is supported.

Applied to 6.18/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen