Thread (66 messages) 66 messages, 7 authors, 2021-10-29

Re: Missing driver-specific sysfs attributes of scsi_device [was: Re: [PATCH v4 00/46] Register SCSI sysfs attributes earlier]

From: Bart Van Assche <bvanassche@acm.org>
Date: 2021-10-24 02:56:04
Also in: linux-next, linux-s390

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help