Skip to content

Commit f838d62

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: ufs: core: Revert "Make HID attributes visible"
Patch "Make HID attributes visible" is needed for older kernel versions (e.g. 6.12) where ufs_get_device_desc() is called from ufshcd_probe_hba(). In these older kernel versions ufshcd_get_device_desc() may be called after the sysfs attributes have been added. In the upstream kernel however ufshcd_get_device_desc() is called before ufs_sysfs_add_nodes(). See also the ufshcd_device_params_init() call from ufshcd_init(). Hence, calling sysfs_update_group() is not necessary. See also commit 69f5eb7 ("scsi: ufs: core: Move the ufshcd_device_init(hba, true) call") in kernel v6.13. This patch fixes the following kernel warning: sysfs: cannot create duplicate filename '/devices/platform/3c2d0000.ufs/hid' Workqueue: async async_run_entry_fn Call trace: dump_backtrace+0xfc/0x17c show_stack+0x18/0x28 dump_stack_lvl+0x40/0x104 dump_stack+0x18/0x3c sysfs_warn_dup+0x6c/0xc8 internal_create_group+0x1c8/0x504 sysfs_create_groups+0x38/0x9c ufs_sysfs_add_nodes+0x20/0x58 ufshcd_init+0x1114/0x134c ufshcd_pltfrm_init+0x728/0x7d8 ufs_google_probe+0x30/0x84 platform_probe+0xa0/0xe0 really_probe+0x114/0x454 __driver_probe_device+0xa4/0x160 driver_probe_device+0x44/0x23c __device_attach_driver+0x15c/0x1f4 bus_for_each_drv+0x10c/0x168 __device_attach_async_helper+0x80/0xf8 async_run_entry_fn+0x4c/0x17c process_one_work+0x26c/0x65c worker_thread+0x33c/0x498 kthread+0x110/0x134 ret_from_fork+0x10/0x20 ufshcd 3c2d0000.ufs: ufs_sysfs_add_nodes: sysfs groups creation failed (err = -17) Cc: Daniel Lee <chullee@google.com> Cc: Peter Wang <peter.wang@mediatek.com> Cc: Bjorn Andersson <andersson@kernel.org> Cc: Neil Armstrong <neil.armstrong@linaro.org> Fixes: bb7663d ("scsi: ufs: sysfs: Make HID attributes visible") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Fixes: bb7663d ("scsi: ufs: sysfs: Make HID attributes visible") Acked-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Peter Wang <peter.wang@mediatek.com> Reviewed-by: Bjorn Andersson <andersson@kernel.org> Link: https://patch.msgid.link/20251028222433.1108299-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent c0e37ac commit f838d62

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

drivers/ufs/core/ufs-sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,7 @@ static umode_t ufs_sysfs_hid_is_visible(struct kobject *kobj,
19491949
return hba->dev_info.hid_sup ? attr->mode : 0;
19501950
}
19511951

1952-
const struct attribute_group ufs_sysfs_hid_group = {
1952+
static const struct attribute_group ufs_sysfs_hid_group = {
19531953
.name = "hid",
19541954
.attrs = ufs_sysfs_hid,
19551955
.is_visible = ufs_sysfs_hid_is_visible,

drivers/ufs/core/ufs-sysfs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ void ufs_sysfs_remove_nodes(struct device *dev);
1414

1515
extern const struct attribute_group ufs_sysfs_unit_descriptor_group;
1616
extern const struct attribute_group ufs_sysfs_lun_attributes_group;
17-
extern const struct attribute_group ufs_sysfs_hid_group;
1817

1918
#endif

drivers/ufs/core/ufshcd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8499,8 +8499,6 @@ static int ufs_get_device_desc(struct ufs_hba *hba)
84998499
DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP) &
85008500
UFS_DEV_HID_SUPPORT;
85018501

8502-
sysfs_update_group(&hba->dev->kobj, &ufs_sysfs_hid_group);
8503-
85048502
model_index = desc_buf[DEVICE_DESC_PARAM_PRDCT_NAME];
85058503

85068504
err = ufshcd_read_string_desc(hba, model_index,

0 commit comments

Comments
 (0)