]> www.infradead.org Git - users/hch/misc.git/commitdiff
scsi: ufs: sysfs: Make HID attributes visible
authorDaniel Lee <chullee@google.com>
Tue, 30 Sep 2025 01:09:39 +0000 (18:09 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 30 Sep 2025 19:46:28 +0000 (15:46 -0400)
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")
Signed-off-by: Daniel Lee <chullee@google.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufs-sysfs.c
drivers/ufs/core/ufs-sysfs.h
drivers/ufs/core/ufshcd.c

index 0086816b27cd9041b4289d8a292f8b3fd511e17c..c040afc6668e8c387dd85dc77e846c5797c278f3 100644 (file)
@@ -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,
index 8d94af3b80771932557a7ab66a57afbe81413e00..6efb82a082fdd3391f71cc168e32476293ea53ee 100644 (file)
@@ -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
index 319dd6f6229bdba5b24a75051611a4d53ba6b384..127b691402f994dd7c0e40be7ae3430e8f088f3e 100644 (file)
@@ -8480,6 +8480,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,