On 10/23/21 17:39, Steffen Maier wrote:
I tried to fix it by assigning the pointer of that new field to the groups
field of sdev_gendev so the driver core gets our groups on devide_add().
Just like scsi_host_alloc() was changed by the same commit,
although scsi_host_alloc() already had assigned something to
shost_dev.groups so the necessary change was more obvious there.
Thanks for having reported this early. We probably need something like this
(entirely untested):
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1583,7 +1583,7 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev)
scsi_enable_async_suspend(&sdev->sdev_gendev);
dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%llu",
sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
- sdev->gendev_attr_groups[j++] = &scsi_sdev_attr_group;
+ sdev->sdev_gendev.groups = sdev->gendev_attr_groups;
if (hostt->sdev_groups) {
for (i = 0; hostt->sdev_groups[i] &&
j < ARRAY_SIZE(sdev->gendev_attr_groups);
Bart.