* [PATCH] scsi: ufs: sysfs: Make HID attributes visible
@ 2025-09-30 1:09 Daniel Lee
2025-09-30 17:18 ` Bart Van Assche
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Daniel Lee @ 2025-09-30 1:09 UTC (permalink / raw)
To: James.Bottomley, martin.petersen
Cc: alim.akhtar, avri.altman, bvanassche, tanghuan, linux-scsi,
linux-kernel, Daniel Lee
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>
---
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(-)
diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-sysfs.c
index 0086816b27cd..c040afc6668e 100644
--- a/drivers/ufs/core/ufs-sysfs.c
+++ b/drivers/ufs/core/ufs-sysfs.c
@@ -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,
diff --git a/drivers/ufs/core/ufs-sysfs.h b/drivers/ufs/core/ufs-sysfs.h
index 8d94af3b8077..6efb82a082fd 100644
--- a/drivers/ufs/core/ufs-sysfs.h
+++ b/drivers/ufs/core/ufs-sysfs.h
@@ -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
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index b2e103aa4e62..bace5112e095 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -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,
--
2.51.0.618.g983fd99d29-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: ufs: sysfs: Make HID attributes visible
2025-09-30 1:09 [PATCH] scsi: ufs: sysfs: Make HID attributes visible Daniel Lee
@ 2025-09-30 17:18 ` Bart Van Assche
2025-09-30 19:50 ` Martin K. Petersen
2025-10-07 2:38 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2025-09-30 17:18 UTC (permalink / raw)
To: Daniel Lee, James.Bottomley, martin.petersen
Cc: alim.akhtar, avri.altman, tanghuan, linux-scsi, linux-kernel
On 9/29/25 6:09 PM, Daniel Lee wrote:
> Call sysfs_update_group() after reading the device descriptor
> to ensure the HID sysfs attributes are visible when the feature
> is supported.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: ufs: sysfs: Make HID attributes visible
2025-09-30 1:09 [PATCH] scsi: ufs: sysfs: Make HID attributes visible Daniel Lee
2025-09-30 17:18 ` Bart Van Assche
@ 2025-09-30 19:50 ` Martin K. Petersen
2025-10-07 2:38 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2025-09-30 19:50 UTC (permalink / raw)
To: Daniel Lee
Cc: James.Bottomley, martin.petersen, alim.akhtar, avri.altman,
bvanassche, tanghuan, linux-scsi, linux-kernel
Daniel,
> 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!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: ufs: sysfs: Make HID attributes visible
2025-09-30 1:09 [PATCH] scsi: ufs: sysfs: Make HID attributes visible Daniel Lee
2025-09-30 17:18 ` Bart Van Assche
2025-09-30 19:50 ` Martin K. Petersen
@ 2025-10-07 2:38 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2025-10-07 2:38 UTC (permalink / raw)
To: James.Bottomley, Daniel Lee
Cc: Martin K . Petersen, alim.akhtar, avri.altman, bvanassche,
tanghuan, linux-scsi, linux-kernel
On Mon, 29 Sep 2025 18:09:39 -0700, Daniel Lee wrote:
> 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-queue, thanks!
[1/1] scsi: ufs: sysfs: Make HID attributes visible
https://git.kernel.org/mkp/scsi/c/bb7663dec67b
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-10-07 2:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-30 1:09 [PATCH] scsi: ufs: sysfs: Make HID attributes visible Daniel Lee
2025-09-30 17:18 ` Bart Van Assche
2025-09-30 19:50 ` Martin K. Petersen
2025-10-07 2:38 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox