Register SCSI sysfs attributes earlier
Bart Van Assche
maintainerv4 cover Register SCSI sysfs attributes earlier
Hi Martin,
For certain user space software, e.g. udev, it is important that sysfs attributes are registered before the KOBJ_ADD uevent is emitted. Hence this patch series that removes the device_create_file() and sysfs_create_groups() calls from the SCSI core. Please consider this patch series for kernel v5.16.
Thanks,
Bart.
Changes compared to v3:
- Updated Acked-by / Reviewed-by tags.
- In the zfcp driver, restored the zfcp_sysfs_ prefix.
- Fixed a bug in the patch for the qla2xxx driver.
Changes compared to v2:
- Use the ATTRIBUTE_GROUPS() macro where appropriate.
Changes compared to v1:
- Switched from struct attribute ** to struct attribute_group **.
- Added comments that explain how the size of the new arrays have been chosen.
- Cleaned up the code in the qla2xxx driver that modifies a struct device_attribute array by introducing an .is_visible() callback.
- Split this patch series into one patch per driver.
Bart Van Assche (46):
scsi: core: Register sysfs attributes earlier
ata: Switch to attribute groups
firewire: sbp2: Switch to attribute groups
RDMA/srp: Switch to attribute groups
scsi: message: fusion: Switch to attribute groups
scsi: zfcp: Switch to attribute groups
scsi: 3w-9xxx: Switch to attribute groups
scsi: 3w-sas: Switch to attribute groups
scsi: 3w-xxxx: Switch to attribute groups
scsi: 53c700: Switch to attribute groups
scsi: aacraid: Switch to attribute groups
scsi: arcmsr: Switch to attribute groups
scsi: be2iscsi: Switch to attribute groups
scsi: bfa: Switch to attribute groups
scsi: bnx2fc: Switch to attribute groups
scsi: bnx2i: Switch to attribute groups
scsi: csiostor: Switch to attribute groups
scsi: cxlflash: Switch to attribute groups
scsi: fnic: Switch to attribute groups
scsi: hisi_sas: Switch to attribute groups
scsi: hpsa: Switch to attribute groups
scsi: hptiop: Switch to attribute groups
scsi: ibmvscsi: Switch to attribute groups
scsi: ibmvfc: Switch to attribute groups
scsi: ipr: Switch to attribute groups
scsi: isci: Switch to attribute groups
scsi: lpfc: Switch to attribute groups
scsi: megaraid: Switch to attribute groups
scsi: mpt3sas: Switch to attribute groups
scsi: mvsas: Switch to attribute groups
scsi: myrb: Switch to attribute groups
scsi: myrs: Switch to attribute groups
scsi: ncr53c8xx: Switch to attribute groups
scsi: sym53c500_cs: Switch to attribute groups
scsi: pm8001: Switch to attribute groups
scsi: pmcraid: Switch to attribute groups
scsi: qedf: Switch to attribute groups
scsi: qedi: Switch to attribute groups
scsi: qla2xxx: Remove a declaration
scsi: qla2xxx: Switch to attribute groups
scsi: qla4xxx: Switch to attribute groups
scsi: smartpqi: Switch to attribute groups
scsi: snic: Switch to attribute groups
scsi: unisys: Remove the shost_attrs member
scsi: usb: Switch to attribute groups
scsi: core: Remove two host template members that are no longer used
drivers/ata/ahci.h | 8 +- drivers/ata/ata_piix.c | 8 +- drivers/ata/libahci.c | 52 ++- drivers/ata/libata-sata.c | 19 +- drivers/ata/libata-scsi.c | 15 +- drivers/ata/pata_macio.c | 2 +- drivers/ata/sata_mv.c | 2 +- drivers/ata/sata_nv.c | 4 +- drivers/ata/sata_sil24.c | 2 +- drivers/firewire/sbp2.c | 8 +- drivers/infiniband/ulp/srp/ib_srp.c | 51 +-- drivers/message/fusion/mptfc.c | 2 +- drivers/message/fusion/mptsas.c | 2 +- drivers/message/fusion/mptscsih.c | 36 +- drivers/message/fusion/mptscsih.h | 2 +- drivers/message/fusion/mptspi.c | 2 +- drivers/s390/scsi/zfcp_ext.h | 4 +- drivers/s390/scsi/zfcp_scsi.c | 4 +- drivers/s390/scsi/zfcp_sysfs.c | 52 ++- drivers/scsi/3w-9xxx.c | 8 +- drivers/scsi/3w-sas.c | 8 +- drivers/scsi/3w-xxxx.c | 8 +- drivers/scsi/53c700.c | 12 +- drivers/scsi/aacraid/linit.c | 38 ++- drivers/scsi/arcmsr/arcmsr.h | 2 +- drivers/scsi/arcmsr/arcmsr_attr.c | 33 +- drivers/scsi/arcmsr/arcmsr_hba.c | 2 +- drivers/scsi/be2iscsi/be_main.c | 21 +- drivers/scsi/bfa/bfad_attr.c | 68 ++-- drivers/scsi/bfa/bfad_im.c | 4 +- drivers/scsi/bfa/bfad_im.h | 4 +- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 8 +- drivers/scsi/bnx2i/bnx2i.h | 2 +- drivers/scsi/bnx2i/bnx2i_iscsi.c | 2 +- drivers/scsi/bnx2i/bnx2i_sysfs.c | 15 +- drivers/scsi/csiostor/csio_scsi.c | 24 +- drivers/scsi/cxlflash/main.c | 40 ++- drivers/scsi/fnic/fnic.h | 2 +- drivers/scsi/fnic/fnic_attrs.c | 17 +- drivers/scsi/fnic/fnic_main.c | 2 +- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 8 +- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 8 +- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 14 +- drivers/scsi/hosts.c | 14 +- drivers/scsi/hpsa.c | 44 +-- drivers/scsi/hptiop.c | 10 +- drivers/scsi/ibmvscsi/ibmvfc.c | 22 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 22 +- drivers/scsi/ipr.c | 38 ++- drivers/scsi/isci/init.c | 8 +- drivers/scsi/lpfc/lpfc_attr.c | 314 +++++++++--------- drivers/scsi/lpfc/lpfc_crtn.h | 4 +- drivers/scsi/lpfc/lpfc_init.c | 2 +- drivers/scsi/lpfc/lpfc_scsi.c | 4 +- drivers/scsi/megaraid/megaraid_mbox.c | 15 +- drivers/scsi/megaraid/megaraid_sas_base.c | 24 +- drivers/scsi/mpt3sas/mpt3sas_base.h | 4 +- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 84 +++-- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 8 +- drivers/scsi/mvsas/mv_init.c | 12 +- drivers/scsi/myrb.c | 28 +- drivers/scsi/myrs.c | 40 ++- drivers/scsi/ncr53c8xx.c | 10 +- drivers/scsi/pcmcia/sym53c500_cs.c | 8 +- drivers/scsi/pm8001/pm8001_ctl.c | 64 ++-- drivers/scsi/pm8001/pm8001_init.c | 2 +- drivers/scsi/pm8001/pm8001_sas.h | 2 +- drivers/scsi/pmcraid.c | 11 +- drivers/scsi/qedf/qedf.h | 2 +- drivers/scsi/qedf/qedf_attr.c | 15 +- drivers/scsi/qedf/qedf_main.c | 2 +- drivers/scsi/qedi/qedi_gbl.h | 2 +- drivers/scsi/qedi/qedi_iscsi.c | 2 +- drivers/scsi/qedi/qedi_sysfs.c | 15 +- drivers/scsi/qla2xxx/qla_attr.c | 125 +++---- drivers/scsi/qla2xxx/qla_gbl.h | 4 +- drivers/scsi/qla2xxx/qla_os.c | 5 +- drivers/scsi/qla4xxx/ql4_attr.c | 41 ++- drivers/scsi/qla4xxx/ql4_glbl.h | 3 +- drivers/scsi/qla4xxx/ql4_os.c | 2 +- drivers/scsi/scsi_priv.h | 2 +- drivers/scsi/scsi_sysfs.c | 53 +-- drivers/scsi/smartpqi/smartpqi_init.c | 46 +-- drivers/scsi/snic/snic.h | 2 +- drivers/scsi/snic/snic_attrs.c | 19 +- drivers/scsi/snic/snic_main.c | 2 +- .../staging/unisys/visorhba/visorhba_main.c | 1 - drivers/usb/storage/scsiglue.c | 8 +- include/linux/libata.h | 8 +- include/scsi/scsi_device.h | 6 + include/scsi/scsi_host.h | 15 +- 91 files changed, 1029 insertions(+), 770 deletions(-)
Bart Van Assche
maintainerPATCH v4 1/46 scsi: core: Register sysfs attributes earlier
A quote from Documentation/driver-api/driver-model/device.rst:
"Word of warning: While the kernel allows device_create_file() and device_remove_file() to be called on a device at any time, userspace has strict expectations on when attributes get created. When a new device is registered in the kernel, a uevent is generated to notify userspace (like udev) that a new device is available. If attributes are added after the device is registered, then userspace won't get notified and userspace will not know about the new attributes."
Hence register SCSI host sysfs attributes before the SCSI host shost_dev uevent is emitted instead of after that event has been emitted.
--- drivers/scsi/hosts.c | 23 ++++++++++- drivers/scsi/scsi_priv.h | 4 +- drivers/scsi/scsi_sysfs.c | 81 +++++++++++++++++++------------------- include/scsi/scsi_device.h | 7 ++++ include/scsi/scsi_host.h | 12 ++++++ 5 files changed, 84 insertions(+), 43 deletions(-)
drivers/scsi/hosts.c +21 -2
@@ -376,7 +376,7 @@ static struct device_type scsi_host_type = {struct Scsi_Host *scsi_host_alloc (struct scsi_host_template *sht,int privsize) {struct Scsi_Host *shost; -int index; +int index, i, j =0 ; shost =kzalloc (sizeof (struct Scsi_Host ) + privsize,GFP_KERNEL );if (!shost)
@@ -480,7 +480,26 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) shost->shost_dev.parent = &shost->shost_gendev; shost->shost_dev.class = &shost_class;dev_set_name (&shost->shost_dev,"host%d" , shost->host_no); - shost->shost_dev.groups = scsi_sysfs_shost_attr_groups; + shost->shost_dev.groups = shost->shost_dev_attr_groups; + shost->shost_dev_attr_groups[j++] = &scsi_shost_attr_group; +if (sht->shost_attrs) { + shost->lld_attr_group = (struct attribute_group ){ + .attrs =scsi_convert_dev_attrs (&shost->shost_gendev, + sht->shost_attrs) + }; +if (shost->lld_attr_group.attrs) + shost->shost_dev_attr_groups[j++] = + &shost->lld_attr_group; + } +if (sht->shost_groups) { +for (i =0 ; sht->shost_groups[i] && + j <ARRAY_SIZE (shost->shost_dev_attr_groups); + i++, j++) { + shost->shost_dev_attr_groups[j] = + sht->shost_groups[i]; + } + } +WARN_ON_ONCE (j >=ARRAY_SIZE (shost->shost_dev_attr_groups)); shost->ehandler =kthread_run (scsi_error_handler, shost,"scsi_eh_%d" , shost->host_no);
drivers/scsi/scsi_priv.h +3 -1
@@ -137,13 +137,15 @@ extern int scsi_sysfs_add_sdev(struct scsi_device *);extern int scsi_sysfs_add_host (struct Scsi_Host *);extern int scsi_sysfs_register (void );extern void scsi_sysfs_unregister (void ); +struct attribute **scsi_convert_dev_attrs (struct device *dev, +struct device_attribute **dev_attr);extern void scsi_sysfs_device_initialize (struct scsi_device *);extern int scsi_sysfs_target_initialize (struct scsi_device *);extern struct scsi_transport_template blank_transport_template;extern void __scsi_remove_device (struct scsi_device *);extern struct bus_type scsi_bus_type; -extern const struct attribute_group *scsi_sysfs_shost_attr_groups[]; +extern const struct attribute_group scsi_shost_attr_group;/* scsi_netlink.c */ #ifdef CONFIG_SCSI_NETLINK
drivers/scsi/scsi_sysfs.c +41 -40
133 lines not on this page · raw message
include/scsi/scsi_device.h +7 -0
@@ -225,6 +225,13 @@ struct scsi_device {struct device sdev_gendev, sdev_dev; +struct attribute_group lld_attr_group; +/* +* The array size 6 provides space for one attribute group for the +* SCSI core, four attribute groups defined by SCSI LLDs and one +* terminating NULL pointer. +*/ +const struct attribute_group *gendev_attr_groups[6 ];struct execute_work ew;/* used to get process context on put */ struct work_struct requeue_work;
include/scsi/scsi_host.h +12 -0
@@ -483,6 +483,11 @@ struct scsi_host_template {*/ struct device_attribute **sdev_attrs; +/* +* Pointer to the SCSI host sysfs attribute groups, NULL terminated. +*/ +const struct attribute_group **shost_groups; +/* * Pointer to the SCSI device attribute groups for this host, * NULL terminated.
@@ -695,6 +700,13 @@ struct Scsi_Host {/* ldm bits */ struct device shost_gendev, shost_dev; +struct attribute_group lld_attr_group; +/* +* The array size 3 provides space for one attribute group defined by +* the SCSI core, one attribute group defined by the SCSI LLD and one +* terminating NULL pointer. +*/ +const struct attribute_group *shost_dev_attr_groups[3 ];/* * Points to the transport data (if any) which is allocated
Bart Van Assche
maintainerPATCH v4 2/46 ata: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/ata/ahci.h | 8 +++--- drivers/ata/ata_piix.c | 8 +++--- drivers/ata/libahci.c | 52 ++++++++++++++++++++++++++------------- drivers/ata/libata-sata.c | 19 ++++++++++---- drivers/ata/libata-scsi.c | 15 ++++++++--- drivers/ata/pata_macio.c | 2 +- drivers/ata/sata_mv.c | 2 +- drivers/ata/sata_nv.c | 4 +-- drivers/ata/sata_sil24.c | 2 +- include/linux/libata.h | 8 +++--- 10 files changed, 79 insertions(+), 41 deletions(-)
drivers/ata/ahci.h +4 -4
@@ -376,8 +376,8 @@ struct ahci_host_priv {extern int ahci_ignore_sss; -extern struct device_attribute *ahci_shost_attrs[]; -extern struct device_attribute *ahci_sdev_attrs[]; +extern const struct attribute_group *ahci_shost_groups[]; +extern const struct attribute_group *ahci_sdev_groups[];/* * This must be instantiated by the edge drivers. Read the comments
@@ -388,8 +388,8 @@ extern struct device_attribute *ahci_sdev_attrs[]; .can_queue = AHCI_MAX_CMDS, \ .sg_tablesize = AHCI_MAX_SG, \ .dma_boundary = AHCI_DMA_BOUNDARY, \ - .shost_attrs = ahci_shost_attrs, \ - .sdev_attrs = ahci_sdev_attrs, \ + .shost_groups = ahci_shost_groups, \ + .sdev_groups = ahci_sdev_groups, \ .change_queue_depth = ata_scsi_change_queue_depth, \ .tag_alloc_policy =BLK_TAG_ALLOC_RR , \ .slave_configure = ata_scsi_slave_config
drivers/ata/ata_piix.c +5 -3
@@ -1085,14 +1085,16 @@ static struct ata_port_operations ich_pata_ops = { .set_dmamode = ich_set_dmamode, }; -static struct device_attribute *piix_sidpr_shost_attrs[] = { - &dev_attr_link_power_management_policy, +static struct attribute *piix_sidpr_shost_attrs[] = { + &dev_attr_link_power_management_policy.attr,NULL }; +ATTRIBUTE_GROUPS (piix_sidpr_shost); +static struct scsi_host_template piix_sidpr_sht = {ATA_BMDMA_SHT (DRV_NAME ), - .shost_attrs = piix_sidpr_shost_attrs, + .shost_groups = piix_sidpr_shost_groups, };static struct ata_port_operations piix_sidpr_sata_ops = {
drivers/ata/libahci.c +35 -17
63 lines not on this page · raw message
drivers/ata/libata-sata.c +14 -5
@@ -922,13 +922,22 @@ DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, ata_ncq_prio_enable_show, ata_ncq_prio_enable_store);EXPORT_SYMBOL_GPL (dev_attr_ncq_prio_enable); -struct device_attribute *ata_ncq_sdev_attrs[] = { - &dev_attr_unload_heads, - &dev_attr_ncq_prio_enable, - &dev_attr_ncq_prio_supported, +struct attribute *ata_ncq_sdev_attrs[] = { + &dev_attr_unload_heads.attr, + &dev_attr_ncq_prio_enable.attr, + &dev_attr_ncq_prio_supported.attr,NULL }; -EXPORT_SYMBOL_GPL (ata_ncq_sdev_attrs); + +static const struct attribute_group ata_ncq_sdev_attr_group = { + .attrs = ata_ncq_sdev_attrs +}; + +const struct attribute_group *ata_ncq_sdev_groups[] = { + &ata_ncq_sdev_attr_group, +NULL +}; +EXPORT_SYMBOL_GPL (ata_ncq_sdev_groups); static ssize_t ata_scsi_em_message_store(struct device *dev, struct device_attribute *attr,
drivers/ata/libata-scsi.c +12 -3
@@ -234,11 +234,20 @@ static void ata_scsi_set_invalid_parameter(struct ata_device *dev, field, 0xff, 0); } -struct device_attribute *ata_common_sdev_attrs[] = { - &dev_attr_unload_heads, +static struct attribute *ata_common_sdev_attrs[] = { + &dev_attr_unload_heads.attr,NULL }; -EXPORT_SYMBOL_GPL (ata_common_sdev_attrs); + +static const struct attribute_group ata_common_sdev_attr_group = { + .attrs = ata_common_sdev_attrs +}; + +const struct attribute_group *ata_common_sdev_groups[] = { + &ata_common_sdev_attr_group, +NULL +}; +EXPORT_SYMBOL_GPL (ata_common_sdev_groups);/** * ata_std_bios_param - generic bios head/sector/cylinder calculator used by sd.
drivers/ata/pata_macio.c +1 -1
@@ -923,7 +923,7 @@ static struct scsi_host_template pata_macio_sht = {*/ .max_segment_size = MAX_DBDMA_SEG, .slave_configure = pata_macio_slave_config, - .sdev_attrs = ata_common_sdev_attrs, + .sdev_groups = ata_common_sdev_groups, .can_queue = ATA_DEF_QUEUE, .tag_alloc_policy = BLK_TAG_ALLOC_RR, };
drivers/ata/sata_mv.c +1 -1
@@ -670,7 +670,7 @@ static struct scsi_host_template mv6_sht = { .can_queue = MV_MAX_Q_DEPTH - 1, .sg_tablesize = MV_MAX_SG_CT / 2, .dma_boundary = MV_DMA_BOUNDARY, - .sdev_attrs = ata_ncq_sdev_attrs, + .sdev_groups = ata_ncq_sdev_groups, .change_queue_depth = ata_scsi_change_queue_depth, .tag_alloc_policy =BLK_TAG_ALLOC_RR , .slave_configure = ata_scsi_slave_config
drivers/ata/sata_nv.c +2 -2
@@ -380,7 +380,7 @@ static struct scsi_host_template nv_adma_sht = { .sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN, .dma_boundary = NV_ADMA_DMA_BOUNDARY, .slave_configure = nv_adma_slave_config, - .sdev_attrs = ata_ncq_sdev_attrs, + .sdev_groups = ata_ncq_sdev_groups, .change_queue_depth = ata_scsi_change_queue_depth, .tag_alloc_policy = BLK_TAG_ALLOC_RR, };
@@ -391,7 +391,7 @@ static struct scsi_host_template nv_swncq_sht = { .sg_tablesize = LIBATA_MAX_PRD, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = nv_swncq_slave_config, - .sdev_attrs = ata_ncq_sdev_attrs, + .sdev_groups = ata_ncq_sdev_groups, .change_queue_depth = ata_scsi_change_queue_depth, .tag_alloc_policy = BLK_TAG_ALLOC_RR, };
drivers/ata/sata_sil24.c +1 -1
@@ -379,7 +379,7 @@ static struct scsi_host_template sil24_sht = { .sg_tablesize = SIL24_MAX_SGE, .dma_boundary = ATA_DMA_BOUNDARY, .tag_alloc_policy = BLK_TAG_ALLOC_FIFO, - .sdev_attrs = ata_ncq_sdev_attrs, + .sdev_groups = ata_ncq_sdev_groups, .change_queue_depth = ata_scsi_change_queue_depth, .slave_configure = ata_scsi_slave_config };
include/linux/libata.h +4 -4
@@ -1388,7 +1388,7 @@ extern int ata_link_nr_enabled(struct ata_link *link);*/ extern const struct ata_port_operations ata_base_port_ops;extern const struct ata_port_operations sata_port_ops; -extern struct device_attribute *ata_common_sdev_attrs[]; +extern const struct attribute_group *ata_common_sdev_groups[];/* * All sht initializers (BASE, PIO, BMDMA, NCQ) must be instantiated
@@ -1418,14 +1418,14 @@ extern struct device_attribute *ata_common_sdev_attrs[];#define ATA_BASE_SHT (drv_name) \ ATA_SUBBASE_SHT(drv_name), \ - .sdev_attrs = ata_common_sdev_attrs + .sdev_groups = ata_common_sdev_groups#ifdef CONFIG_SATA_HOST -extern struct device_attribute *ata_ncq_sdev_attrs[]; +extern const struct attribute_group *ata_ncq_sdev_groups[];#define ATA_NCQ_SHT (drv_name) \ ATA_SUBBASE_SHT(drv_name), \ - .sdev_attrs = ata_ncq_sdev_attrs, \ + .sdev_groups = ata_ncq_sdev_groups, \ .change_queue_depth = ata_scsi_change_queue_depth#endif
Bart Van Assche
maintainerPATCH v4 3/46 firewire: sbp2: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/firewire/sbp2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/firewire/sbp2.c +5 -3
@@ -1578,11 +1578,13 @@ static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev, static DEVICE_ATTR(ieee1394_id, S_IRUGO, sbp2_sysfs_ieee1394_id_show, NULL); -static struct device_attribute *sbp2_scsi_sysfs_attrs[] = { - &dev_attr_ieee1394_id, +static struct attribute *sbp2_scsi_sysfs_attrs[] = { + &dev_attr_ieee1394_id.attr,NULL }; +ATTRIBUTE_GROUPS (sbp2_scsi_sysfs); +static struct scsi_host_template scsi_driver_template = { .module =THIS_MODULE , .name ="SBP-2 IEEE-1394" ,
@@ -1595,7 +1597,7 @@ static struct scsi_host_template scsi_driver_template = { .sg_tablesize = SG_ALL, .max_segment_size = SBP2_MAX_SEG_SIZE, .can_queue = 1, - .sdev_attrs = sbp2_scsi_sysfs_attrs, + .sdev_groups = sbp2_scsi_sysfs_groups, };MODULE_AUTHOR ("Kristian Hoegsberg <[email protected]>" );
Bart Van Assche
maintainerPATCH v4 4/46 RDMA/srp: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/infiniband/ulp/srp/ib_srp.c | 51 +++++++++++++++++------------ 1 file changed, 30 insertions(+), 21 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +30 -21
@@ -1026,10 +1026,17 @@ static int srp_init_cmd_priv(struct Scsi_Host *shost, struct scsi_cmnd *cmd)*/ static void srp_del_scsi_host_attr (struct Scsi_Host *shost) { -struct device_attribute **attr; +const struct attribute_group **g; +struct attribute **attr; -for (attr = shost->hostt->shost_attrs; attr && *attr; ++attr) -device_remove_file (&shost->shost_dev, *attr); +for (g = shost->hostt->shost_groups; *g; ++g) { +for (attr = (*g)->attrs; *attr; ++attr) { +struct device_attribute *dev_attr = +container_of (*attr,typeof (*dev_attr), attr); + +device_remove_file (&shost->shost_dev, dev_attr); + } + } }static void srp_remove_target (struct srp_target_port *target)
@@ -3050,26 +3057,28 @@ static ssize_t allow_ext_sg_show(struct device *dev,static DEVICE_ATTR_RO (allow_ext_sg); -static struct device_attribute *srp_host_attrs[] = { - &dev_attr_id_ext, - &dev_attr_ioc_guid, - &dev_attr_service_id, - &dev_attr_pkey, - &dev_attr_sgid, - &dev_attr_dgid, - &dev_attr_orig_dgid, - &dev_attr_req_lim, - &dev_attr_zero_req_lim, - &dev_attr_local_ib_port, - &dev_attr_local_ib_device, - &dev_attr_ch_count, - &dev_attr_comp_vector, - &dev_attr_tl_retry_count, - &dev_attr_cmd_sg_entries, - &dev_attr_allow_ext_sg, +static struct attribute *srp_host_attrs[] = { + &dev_attr_id_ext.attr, + &dev_attr_ioc_guid.attr, + &dev_attr_service_id.attr, + &dev_attr_pkey.attr, + &dev_attr_sgid.attr, + &dev_attr_dgid.attr, + &dev_attr_orig_dgid.attr, + &dev_attr_req_lim.attr, + &dev_attr_zero_req_lim.attr, + &dev_attr_local_ib_port.attr, + &dev_attr_local_ib_device.attr, + &dev_attr_ch_count.attr, + &dev_attr_comp_vector.attr, + &dev_attr_tl_retry_count.attr, + &dev_attr_cmd_sg_entries.attr, + &dev_attr_allow_ext_sg.attr,NULL }; +ATTRIBUTE_GROUPS (srp_host); +static struct scsi_host_template srp_template = { .module =THIS_MODULE , .name ="InfiniBand SRP initiator" ,
@@ -3090,7 +3099,7 @@ static struct scsi_host_template srp_template = { .can_queue = SRP_DEFAULT_CMD_SQ_SIZE, .this_id = -1, .cmd_per_lun = SRP_DEFAULT_CMD_SQ_SIZE, - .shost_attrs = srp_host_attrs, + .shost_groups = srp_host_groups, .track_queue_depth = 1, .cmd_size = sizeof(struct srp_request), };
Bart Van Assche
maintainerPATCH v4 5/46 scsi: message: fusion: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/message/fusion/mptfc.c | 2 +- drivers/message/fusion/mptsas.c | 2 +- drivers/message/fusion/mptscsih.c | 36 +++++++++++++++++++------------ drivers/message/fusion/mptscsih.h | 2 +- drivers/message/fusion/mptspi.c | 2 +- 5 files changed, 26 insertions(+), 18 deletions(-)
drivers/message/fusion/mptfc.c +1 -1
@@ -129,7 +129,7 @@ static struct scsi_host_template mptfc_driver_template = { .sg_tablesize = MPT_SCSI_SG_DEPTH, .max_sectors = 8192, .cmd_per_lun = 7, - .shost_attrs = mptscsih_host_attrs, + .shost_groups = mptscsih_host_attr_groups, };/****************************************************************************
drivers/message/fusion/mptsas.c +1 -1
@@ -2020,7 +2020,7 @@ static struct scsi_host_template mptsas_driver_template = { .sg_tablesize = MPT_SCSI_SG_DEPTH, .max_sectors = 8192, .cmd_per_lun = 7, - .shost_attrs = mptscsih_host_attrs, + .shost_groups = mptscsih_host_attr_groups, .no_write_same = 1, };
drivers/message/fusion/mptscsih.c +22 -14
@@ -3218,23 +3218,31 @@ mptscsih_debug_level_store(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR, mptscsih_debug_level_show, mptscsih_debug_level_store); -struct device_attribute *mptscsih_host_attrs[] = { - &dev_attr_version_fw, - &dev_attr_version_bios, - &dev_attr_version_mpi, - &dev_attr_version_product, - &dev_attr_version_nvdata_persistent, - &dev_attr_version_nvdata_default, - &dev_attr_board_name, - &dev_attr_board_assembly, - &dev_attr_board_tracer, - &dev_attr_io_delay, - &dev_attr_device_delay, - &dev_attr_debug_level, +static struct attribute *mptscsih_host_attrs[] = { + &dev_attr_version_fw.attr, + &dev_attr_version_bios.attr, + &dev_attr_version_mpi.attr, + &dev_attr_version_product.attr, + &dev_attr_version_nvdata_persistent.attr, + &dev_attr_version_nvdata_default.attr, + &dev_attr_board_name.attr, + &dev_attr_board_assembly.attr, + &dev_attr_board_tracer.attr, + &dev_attr_io_delay.attr, + &dev_attr_device_delay.attr, + &dev_attr_debug_level.attr,NULL , }; -EXPORT_SYMBOL (mptscsih_host_attrs); +static const struct attribute_group mptscsih_host_attr_group = { + .attrs = mptscsih_host_attrs +}; + +const struct attribute_group *mptscsih_host_attr_groups[] = { + &mptscsih_host_attr_group, +NULL +}; +EXPORT_SYMBOL (mptscsih_host_attr_groups);EXPORT_SYMBOL (mptscsih_remove);EXPORT_SYMBOL (mptscsih_shutdown);
drivers/message/fusion/mptscsih.h +1 -1
@@ -131,7 +131,7 @@ extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);extern int mptscsih_change_queue_depth (struct scsi_device *sdev,int qdepth);extern u8 mptscsih_raid_id_to_num (MPT_ADAPTER *ioc,u8 channel,u8 id);extern int mptscsih_is_phys_disk (MPT_ADAPTER *ioc,u8 channel,u8 id); -extern struct device_attribute *mptscsih_host_attrs[]; +extern const struct attribute_group *mptscsih_host_attr_groups[];extern struct scsi_cmnd *mptscsih_get_scsi_lookup (MPT_ADAPTER *ioc,int i);extern void mptscsih_taskmgmt_response_code (MPT_ADAPTER *ioc,u8 response_code);extern void mptscsih_flush_running_cmds (MPT_SCSI_HOST *hd);
drivers/message/fusion/mptspi.c +1 -1
@@ -843,7 +843,7 @@ static struct scsi_host_template mptspi_driver_template = { .sg_tablesize = MPT_SCSI_SG_DEPTH, .max_sectors = 8192, .cmd_per_lun = 7, - .shost_attrs = mptscsih_host_attrs, + .shost_groups = mptscsih_host_attr_groups, }; static int mptspi_write_spi_device_pg1(struct scsi_target *starget,
Bart Van Assche
maintainerPATCH v4 6/46 scsi: zfcp: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/s390/scsi/zfcp_ext.h | 4 +-- drivers/s390/scsi/zfcp_scsi.c | 4 +-- drivers/s390/scsi/zfcp_sysfs.c | 52 +++++++++++++++++++++++----------- 3 files changed, 39 insertions(+), 21 deletions(-)
drivers/s390/scsi/zfcp_ext.h +2 -2
@@ -184,8 +184,8 @@ extern const struct attribute_group *zfcp_sysfs_adapter_attr_groups[];extern const struct attribute_group *zfcp_unit_attr_groups[];extern const struct attribute_group *zfcp_port_attr_groups[];extern struct mutex zfcp_sysfs_port_units_mutex; -extern struct device_attribute *zfcp_sysfs_sdev_attrs[]; -extern struct device_attribute *zfcp_sysfs_shost_attrs[]; +extern const struct attribute_group *zfcp_sysfs_sdev_attr_groups[]; +extern const struct attribute_group *zfcp_sysfs_shost_attr_groups[];bool zfcp_sysfs_port_is_removing (const struct zfcp_port *const port);/* zfcp_unit.c */
drivers/s390/scsi/zfcp_scsi.c +2 -2
@@ -444,8 +444,8 @@ static struct scsi_host_template zfcp_scsi_host_template = {/* report size limit per scatter-gather segment */ .max_segment_size = ZFCP_QDIO_SBALE_LEN, .dma_boundary = ZFCP_QDIO_SBALE_LEN - 1, - .shost_attrs = zfcp_sysfs_shost_attrs, - .sdev_attrs = zfcp_sysfs_sdev_attrs, + .shost_groups = zfcp_sysfs_shost_attr_groups, + .sdev_groups = zfcp_sysfs_sdev_attr_groups, .track_queue_depth = 1, .supported_mode = MODE_INITIATOR, };
drivers/s390/scsi/zfcp_sysfs.c +35 -17
64 lines not on this page · raw message
Re: [PATCH v4 06/46] scsi: zfcp: Switch to attribute groups
Hey Bart,
thanks for the change.
Quoted 10 lines · Bart Van Assche
struct device supports attribute groups directly but does not support struct
device_attributedirectly. Hence switch to attribute groups.Signed-off-by Bart Van Assche <[email protected]>--- drivers/s390/scsi/zfcp_ext.h | 4 +-- drivers/s390/scsi/zfcp_scsi.c | 4 +-- drivers/s390/scsi/zfcp_sysfs.c | 52 +++++++++++++++++++++++----------- 3 files changed, 39 insertions(+), 21 deletions(-)
Signature · 4 lines
Best Regards, Benjamin Block / Linux on IBM Z Kernel Development / IBM Systems IBM Deutschland Research & Development GmbH / https://www.ibm.com/privacy Vorsitz. AufsR.: Gregor Pillen / Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294
Bart Van Assche
maintainerPATCH v4 7/46 scsi: 3w-9xxx: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/3w-9xxx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/3w-9xxx.c +5 -3
@@ -197,11 +197,13 @@ static struct device_attribute twa_host_stats_attr = { };/* Host attributes initializer */ -static struct device_attribute *twa_host_attrs[] = { - &twa_host_stats_attr, +static struct attribute *twa_host_attrs[] = { + &twa_host_stats_attr.attr,NULL , }; +ATTRIBUTE_GROUPS (twa_host); +/* File operations struct for character device */ static const struct file_operations twa_fops = { .owner =THIS_MODULE ,
@@ -1990,7 +1992,7 @@ static struct scsi_host_template driver_template = { .sg_tablesize = TW_APACHE_MAX_SGL_LENGTH, .max_sectors = TW_MAX_SECTORS, .cmd_per_lun = TW_MAX_CMDS_PER_LUN, - .shost_attrs = twa_host_attrs, + .shost_groups = twa_host_groups, .emulated = 1, .no_write_same = 1, };
Bart Van Assche
maintainerPATCH v4 8/46 scsi: 3w-sas: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/3w-sas.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/3w-sas.c +5 -3
@@ -198,11 +198,13 @@ static struct device_attribute twl_host_stats_attr = { };/* Host attributes initializer */ -static struct device_attribute *twl_host_attrs[] = { - &twl_host_stats_attr, +static struct attribute *twl_host_attrs[] = { + &twl_host_stats_attr.attr,NULL , }; +ATTRIBUTE_GROUPS (twl_host); +/* This function will look up an AEN severity string */ static char *twl_aen_severity_lookup (unsigned char severity_code) {
@@ -1544,7 +1546,7 @@ static struct scsi_host_template driver_template = { .sg_tablesize = TW_LIBERATOR_MAX_SGL_LENGTH, .max_sectors = TW_MAX_SECTORS, .cmd_per_lun = TW_MAX_CMDS_PER_LUN, - .shost_attrs = twl_host_attrs, + .shost_groups = twl_host_groups, .emulated = 1, .no_write_same = 1, };
Bart Van Assche
maintainerPATCH v4 9/46 scsi: 3w-xxxx: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/3w-xxxx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/3w-xxxx.c +5 -3
@@ -532,11 +532,13 @@ static struct device_attribute tw_host_stats_attr = { };/* Host attributes initializer */ -static struct device_attribute *tw_host_attrs[] = { - &tw_host_stats_attr, +static struct attribute *tw_host_attrs[] = { + &tw_host_stats_attr.attr,NULL , }; +ATTRIBUTE_GROUPS (tw_host); +/* This function will read the aen queue from the isr */ static int tw_aen_read_queue (TW_Device_Extension *tw_dev,int request_id) {
@@ -2242,7 +2244,7 @@ static struct scsi_host_template driver_template = { .sg_tablesize = TW_MAX_SGL_LENGTH, .max_sectors = TW_MAX_SECTORS, .cmd_per_lun = TW_MAX_CMDS_PER_LUN, - .shost_attrs = tw_host_attrs, + .shost_groups = tw_host_groups, .emulated = 1, .no_write_same = 1, };
Bart Van Assche
maintainerPATCH v4 10/46 scsi: 53c700: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/53c700.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/scsi/53c700.c +7 -5
@@ -163,7 +163,7 @@ STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt); STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt);static int NCR_700_change_queue_depth (struct scsi_device *SDpnt,int depth); -STATIC struct device_attribute *NCR_700_dev_attrs[]; +STATIC const struct attribute_group *NCR_700_dev_groups[]; STATIC struct scsi_transport_template *NCR_700_transport_template = NULL;
@@ -300,8 +300,8 @@ NCR_700_detect(struct scsi_host_template *tpnt,static int banner =0 ;int j; -if (tpnt->sdev_attrs ==NULL ) - tpnt->sdev_attrs = NCR_700_dev_attrs; +if (tpnt->sdev_groups ==NULL ) + tpnt->sdev_groups = NCR_700_dev_groups; memory =dma_alloc_coherent (dev,TOTAL_MEM_SIZE , &pScript,GFP_KERNEL );if (!memory) {
@@ -2087,11 +2087,13 @@ static struct device_attribute NCR_700_active_tags_attr = { .show = NCR_700_show_active_tags, }; -STATIC struct device_attribute *NCR_700_dev_attrs[] = { - &NCR_700_active_tags_attr, +STATIC struct attribute *NCR_700_dev_attrs[] = { + &NCR_700_active_tags_attr.attr,NULL , }; +ATTRIBUTE_GROUPS (NCR_700_dev); +EXPORT_SYMBOL (NCR_700_detect);EXPORT_SYMBOL (NCR_700_release);EXPORT_SYMBOL (NCR_700_intr);
Bart Van Assche
maintainerPATCH v4 11/46 scsi: aacraid: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/aacraid/linit.c | 38 ++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 17 deletions(-)
drivers/scsi/aacraid/linit.c +21 -17
@@ -605,12 +605,14 @@ static struct device_attribute aac_unique_id_attr = { -static struct device_attribute *aac_dev_attrs[] = { - &aac_raid_level_attr, - &aac_unique_id_attr, +static struct attribute *aac_dev_attrs[] = { + &aac_raid_level_attr.attr, + &aac_unique_id_attr.attr,NULL , }; +ATTRIBUTE_GROUPS (aac_dev); +static int aac_ioctl (struct scsi_device *sdev,unsigned int cmd,void __user *arg) {
@@ -1442,21 +1444,23 @@ static struct device_attribute aac_reset = { .show = aac_show_reset_adapter, }; -static struct device_attribute *aac_attrs[] = { - &aac_model, - &aac_vendor, - &aac_flags, - &aac_kernel_version, - &aac_monitor_version, - &aac_bios_version, - &aac_lld_version, - &aac_serial_number, - &aac_max_channel, - &aac_max_id, - &aac_reset, +static struct attribute *aac_host_attrs[] = { + &aac_model.attr, + &aac_vendor.attr, + &aac_flags.attr, + &aac_kernel_version.attr, + &aac_monitor_version.attr, + &aac_bios_version.attr, + &aac_lld_version.attr, + &aac_serial_number.attr, + &aac_max_channel.attr, + &aac_max_id.attr, + &aac_reset.attr,NULL }; +ATTRIBUTE_GROUPS (aac_host); +ssize_t aac_get_serial_number (struct device *device,char *buf) {return aac_show_serial_number (device, &aac_serial_number, buf);
@@ -1483,10 +1487,10 @@ static struct scsi_host_template aac_driver_template = {#endif .queuecommand = aac_queuecommand, .bios_param = aac_biosparm, - .shost_attrs = aac_attrs, + .shost_groups = aac_host_groups, .slave_configure = aac_slave_configure, .change_queue_depth = aac_change_queue_depth, - .sdev_attrs = aac_dev_attrs, + .sdev_groups = aac_dev_groups, .eh_abort_handler = aac_eh_abort, .eh_device_reset_handler = aac_eh_dev_reset, .eh_target_reset_handler = aac_eh_target_reset,
Bart Van Assche
maintainerPATCH v4 12/46 scsi: arcmsr: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/arcmsr/arcmsr.h | 2 +- drivers/scsi/arcmsr/arcmsr_attr.c | 33 +++++++++++++++++++------------ drivers/scsi/arcmsr/arcmsr_hba.c | 2 +- 3 files changed, 22 insertions(+), 15 deletions(-)
drivers/scsi/arcmsr/arcmsr.h +1 -1
@@ -1041,6 +1041,6 @@ extern uint32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *, struct QBUFFER __iomem *);extern void arcmsr_clear_iop2drv_rqueue_buffer (struct AdapterControlBlock *);extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer (struct AdapterControlBlock *); -extern struct device_attribute *arcmsr_host_attrs[]; +extern const struct attribute_group *arcmsr_host_groups[];extern int arcmsr_alloc_sysfs_attr (struct AdapterControlBlock *);void arcmsr_free_sysfs_attr (struct AdapterControlBlock *acb);
drivers/scsi/arcmsr/arcmsr_attr.c +20 -13
@@ -58,8 +58,6 @@#include <scsi/scsi_transport.h> #include "arcmsr.h" -struct device_attribute *arcmsr_host_attrs[]; - static ssize_t arcmsr_sysfs_iop_message_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin,
@@ -389,16 +387,25 @@ static DEVICE_ATTR(host_fw_numbers_queue, S_IRUGO, arcmsr_attr_host_fw_numbers_q static DEVICE_ATTR(host_fw_sdram_size, S_IRUGO, arcmsr_attr_host_fw_sdram_size, NULL); static DEVICE_ATTR(host_fw_hd_channels, S_IRUGO, arcmsr_attr_host_fw_hd_channels, NULL); -struct device_attribute *arcmsr_host_attrs[] = { - &dev_attr_host_driver_version, - &dev_attr_host_driver_posted_cmd, - &dev_attr_host_driver_reset, - &dev_attr_host_driver_abort, - &dev_attr_host_fw_model, - &dev_attr_host_fw_version, - &dev_attr_host_fw_request_len, - &dev_attr_host_fw_numbers_queue, - &dev_attr_host_fw_sdram_size, - &dev_attr_host_fw_hd_channels, +static struct attribute *arcmsr_host_attrs[] = { + &dev_attr_host_driver_version.attr, + &dev_attr_host_driver_posted_cmd.attr, + &dev_attr_host_driver_reset.attr, + &dev_attr_host_driver_abort.attr, + &dev_attr_host_fw_model.attr, + &dev_attr_host_fw_version.attr, + &dev_attr_host_fw_request_len.attr, + &dev_attr_host_fw_numbers_queue.attr, + &dev_attr_host_fw_sdram_size.attr, + &dev_attr_host_fw_hd_channels.attr,NULL , }; + +static const struct attribute_group arcmsr_host_attr_group = { + .attrs = arcmsr_host_attrs, +}; + +const struct attribute_group *arcmsr_host_groups[] = { + &arcmsr_host_attr_group, +NULL +};
drivers/scsi/arcmsr/arcmsr_hba.c +1 -1
@@ -167,7 +167,7 @@ static struct scsi_host_template arcmsr_scsi_host_template = { .sg_tablesize = ARCMSR_DEFAULT_SG_ENTRIES, .max_sectors = ARCMSR_MAX_XFER_SECTORS_C, .cmd_per_lun = ARCMSR_DEFAULT_CMD_PERLUN, - .shost_attrs = arcmsr_host_attrs, + .shost_groups = arcmsr_host_groups, .no_write_same = 1, };
Bart Van Assche
maintainerPATCH v4 13/46 scsi: be2iscsi: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/be2iscsi/be_main.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/scsi/be2iscsi/be_main.c +12 -9
@@ -163,17 +163,20 @@ DEVICE_ATTR(beiscsi_active_session_count, S_IRUGO, beiscsi_active_session_disp, NULL);DEVICE_ATTR (beiscsi_free_session_count,S_IRUGO , beiscsi_free_session_disp,NULL ); -static struct device_attribute *beiscsi_attrs[] = { - &dev_attr_beiscsi_log_enable, - &dev_attr_beiscsi_drvr_ver, - &dev_attr_beiscsi_adapter_family, - &dev_attr_beiscsi_fw_ver, - &dev_attr_beiscsi_active_session_count, - &dev_attr_beiscsi_free_session_count, - &dev_attr_beiscsi_phys_port, + +static struct attribute *beiscsi_attrs[] = { + &dev_attr_beiscsi_log_enable.attr, + &dev_attr_beiscsi_drvr_ver.attr, + &dev_attr_beiscsi_adapter_family.attr, + &dev_attr_beiscsi_fw_ver.attr, + &dev_attr_beiscsi_active_session_count.attr, + &dev_attr_beiscsi_free_session_count.attr, + &dev_attr_beiscsi_phys_port.attr,NULL , }; +ATTRIBUTE_GROUPS (beiscsi); +static char const *cqe_desc[] = {"RESERVED_DESC" ,"SOL_CMD_COMPLETE" ,
@@ -391,7 +394,7 @@ static struct scsi_host_template beiscsi_sht = { .eh_abort_handler = beiscsi_eh_abort, .eh_device_reset_handler = beiscsi_eh_device_reset, .eh_target_reset_handler = iscsi_eh_session_reset, - .shost_attrs = beiscsi_attrs, + .shost_groups = beiscsi_groups, .sg_tablesize = BEISCSI_SGLIST_ELEMENTS, .can_queue = BE2_IO_DEPTH, .this_id = -1,
Bart Van Assche
maintainerPATCH v4 14/46 scsi: bfa: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/bfa/bfad_attr.c | 68 ++++++++++++++++++++++-------------- drivers/scsi/bfa/bfad_im.c | 4 +-- drivers/scsi/bfa/bfad_im.h | 4 +-- 3 files changed, 46 insertions(+), 30 deletions(-)
drivers/scsi/bfa/bfad_attr.c +42 -26
@@ -956,36 +956,52 @@ static DEVICE_ATTR(driver_name, S_IRUGO, bfad_im_drv_name_show, NULL); static DEVICE_ATTR(number_of_discovered_ports, S_IRUGO, bfad_im_num_of_discovered_ports_show, NULL); -struct device_attribute *bfad_im_host_attrs[] = { - &dev_attr_serial_number, - &dev_attr_model, - &dev_attr_model_description, - &dev_attr_node_name, - &dev_attr_symbolic_name, - &dev_attr_hardware_version, - &dev_attr_driver_version, - &dev_attr_option_rom_version, - &dev_attr_firmware_version, - &dev_attr_number_of_ports, - &dev_attr_driver_name, - &dev_attr_number_of_discovered_ports, +static struct attribute *bfad_im_host_attrs[] = { + &dev_attr_serial_number.attr, + &dev_attr_model.attr, + &dev_attr_model_description.attr, + &dev_attr_node_name.attr, + &dev_attr_symbolic_name.attr, + &dev_attr_hardware_version.attr, + &dev_attr_driver_version.attr, + &dev_attr_option_rom_version.attr, + &dev_attr_firmware_version.attr, + &dev_attr_number_of_ports.attr, + &dev_attr_driver_name.attr, + &dev_attr_number_of_discovered_ports.attr,NULL , }; -struct device_attribute *bfad_im_vport_attrs[] = { - &dev_attr_serial_number, - &dev_attr_model, - &dev_attr_model_description, - &dev_attr_node_name, - &dev_attr_symbolic_name, - &dev_attr_hardware_version, - &dev_attr_driver_version, - &dev_attr_option_rom_version, - &dev_attr_firmware_version, - &dev_attr_number_of_ports, - &dev_attr_driver_name, - &dev_attr_number_of_discovered_ports, +static const struct attribute_group bfad_im_host_attr_group = { + .attrs = bfad_im_host_attrs +}; + +const struct attribute_group *bfad_im_host_groups[] = { + &bfad_im_host_attr_group, +NULL +}; + +struct attribute *bfad_im_vport_attrs[] = { + &dev_attr_serial_number.attr, + &dev_attr_model.attr, + &dev_attr_model_description.attr, + &dev_attr_node_name.attr, + &dev_attr_symbolic_name.attr, + &dev_attr_hardware_version.attr, + &dev_attr_driver_version.attr, + &dev_attr_option_rom_version.attr, + &dev_attr_firmware_version.attr, + &dev_attr_number_of_ports.attr, + &dev_attr_driver_name.attr, + &dev_attr_number_of_discovered_ports.attr,NULL , }; +static const struct attribute_group bfad_im_vport_attr_group = { + .attrs = bfad_im_vport_attrs +}; +const struct attribute_group *bfad_im_vport_groups[] = { + &bfad_im_vport_attr_group, +NULL +};
drivers/scsi/bfa/bfad_im.c +2 -2
@@ -809,7 +809,7 @@ struct scsi_host_template bfad_im_scsi_host_template = { .this_id = -1, .sg_tablesize = BFAD_IO_MAX_SGE, .cmd_per_lun = 3, - .shost_attrs = bfad_im_host_attrs, + .shost_groups = bfad_im_host_groups, .max_sectors = BFAD_MAX_SECTORS, .vendor_id = BFA_PCI_VENDOR_ID_BROCADE, };
@@ -831,7 +831,7 @@ struct scsi_host_template bfad_im_vport_template = { .this_id = -1, .sg_tablesize = BFAD_IO_MAX_SGE, .cmd_per_lun = 3, - .shost_attrs = bfad_im_vport_attrs, + .shost_groups = bfad_im_vport_groups, .max_sectors = BFAD_MAX_SECTORS, };
drivers/scsi/bfa/bfad_im.h +2 -2
@@ -174,8 +174,8 @@ extern struct fc_function_template bfad_im_vport_fc_function_template;extern struct scsi_transport_template *bfad_im_scsi_transport_template;extern struct scsi_transport_template *bfad_im_scsi_vport_transport_template; -extern struct device_attribute *bfad_im_host_attrs[]; -extern struct device_attribute *bfad_im_vport_attrs[]; +extern const struct attribute_group *bfad_im_host_groups[]; +extern const struct attribute_group *bfad_im_vport_groups[];irqreturn_t bfad_intx (int irq,void *dev_id);
kernel test robot
build botRe: [PATCH v4 14/46] scsi: bfa: Switch to attribute groups
I love your patch! Perhaps something to improve:
Hi Bart,
I love your patch! Perhaps something to improve:
[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on jejb-scsi/for-next s390/features linus/master v5.15-rc5 next-20211013] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Bart-Van-Assche/Register-SCSI-sysfs-attributes-earlier/20211013-073856 base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next config: x86_64-randconfig-s021-20211012 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.4-dirty # https://github.com/0day-ci/linux/commit/2b7f54c13f8268dd46abeae708e58ce1811ce52a git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Bart-Van-Assche/Register-SCSI-sysfs-attributes-earlier/20211013-073856 git checkout 2b7f54c13f8268dd46abeae708e58ce1811ce52a # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/scsi/bfa/
If you fix the issue, kindly add following tag as appropriate
sparse warnings: (new ones prefixed by >>)
drivers/scsi/bfa/bfad_attr.c:66:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] node_name @@ got restricted __be64 [usertype] @@
drivers/scsi/bfa/bfad_attr.c:66:39: sparse: expected unsigned long long [usertype] node_name
drivers/scsi/bfa/bfad_attr.c:66:39: sparse: got restricted __be64 [usertype]
drivers/scsi/bfa/bfad_attr.c:92:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] port_name @@ got restricted __be64 [usertype] @@
drivers/scsi/bfa/bfad_attr.c:92:39: sparse: expected unsigned long long [usertype] port_name
drivers/scsi/bfa/bfad_attr.c:92:39: sparse: got restricted __be64 [usertype]
drivers/scsi/bfa/bfad_attr.c:248:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] fabric_name @@ got restricted __be64 [usertype] @@
drivers/scsi/bfa/bfad_attr.c:248:36: sparse: expected unsigned long long [usertype] fabric_name
drivers/scsi/bfa/bfad_attr.c:248:36: sparse: got restricted __be64 [usertype]
>> drivers/scsi/bfa/bfad_attr.c:984:18: sparse: sparse: symbol 'bfad_im_vport_attrs' was not declared. Should it be static?
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build bot[RFC PATCH] scsi: bfa: bfad_im_vport_attrs[] can be static
In reply to Bart Van Asschedrivers/scsi/bfa/bfad_attr.c:984:18: warning: symbol 'bfad_im_vport_attrs' was not declared. Should it be static?
drivers/scsi/bfa/bfad_attr.c:984:18: warning: symbol 'bfad_im_vport_attrs' was not declared. Should it be static?
--- bfad_attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/bfa/bfad_attr.c +1 -1
@@ -981,7 +981,7 @@ const struct attribute_group *bfad_im_host_groups[] = {NULL }; -struct attribute *bfad_im_vport_attrs[] = { +static struct attribute *bfad_im_vport_attrs[] = { &dev_attr_serial_number.attr, &dev_attr_model.attr, &dev_attr_model_description.attr,
Bart Van Assche
maintainerPATCH v4 15/46 scsi: bnx2fc: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +5 -3
@@ -2951,11 +2951,13 @@ bnx2fc_tm_timeout_store(struct device *dev, static DEVICE_ATTR(tm_timeout, S_IRUGO|S_IWUSR, bnx2fc_tm_timeout_show, bnx2fc_tm_timeout_store); -static struct device_attribute *bnx2fc_host_attrs[] = { - &dev_attr_tm_timeout, +static struct attribute *bnx2fc_host_attrs[] = { + &dev_attr_tm_timeout.attr,NULL , }; +ATTRIBUTE_GROUPS (bnx2fc_host); +/* * scsi_host_template structure used while registering with SCSI-ml */
@@ -2977,7 +2979,7 @@ static struct scsi_host_template bnx2fc_shost_template = { .max_sectors = 0x3fbf, .track_queue_depth = 1, .slave_configure = bnx2fc_slave_configure, - .shost_attrs = bnx2fc_host_attrs, + .shost_groups = bnx2fc_host_groups, };static struct libfc_function_template bnx2fc_libfc_fcn_templ = {
Bart Van Assche
maintainerPATCH v4 16/46 scsi: bnx2i: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/bnx2i/bnx2i.h | 2 +- drivers/scsi/bnx2i/bnx2i_iscsi.c | 2 +- drivers/scsi/bnx2i/bnx2i_sysfs.c | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-)
drivers/scsi/bnx2i/bnx2i.h +1 -1
@@ -795,7 +795,7 @@ extern struct cnic_ulp_ops bnx2i_cnic_cb;extern unsigned int sq_size;extern unsigned int rq_size; -extern struct device_attribute *bnx2i_dev_attributes[]; +extern const struct attribute_group *bnx2i_dev_groups[];
drivers/scsi/bnx2i/bnx2i_iscsi.c +1 -1
@@ -2266,7 +2266,7 @@ static struct scsi_host_template bnx2i_host_template = { .cmd_per_lun = 128, .this_id = -1, .sg_tablesize = ISCSI_MAX_BDS_PER_CMD, - .shost_attrs = bnx2i_dev_attributes, + .shost_groups = bnx2i_dev_groups, .track_queue_depth = 1, };
drivers/scsi/bnx2i/bnx2i_sysfs.c +12 -3
@@ -142,8 +142,17 @@ static DEVICE_ATTR(sq_size, S_IRUGO | S_IWUSR, static DEVICE_ATTR(num_ccell, S_IRUGO | S_IWUSR, bnx2i_show_ccell_info, bnx2i_set_ccell_info); -struct device_attribute *bnx2i_dev_attributes[] = { - &dev_attr_sq_size, - &dev_attr_num_ccell, +static struct attribute *bnx2i_dev_attributes[] = { + &dev_attr_sq_size.attr, + &dev_attr_num_ccell.attr, +NULL +}; + +static const struct attribute_group bnx2i_dev_attr_group = { + .attrs = bnx2i_dev_attributes +}; + +const struct attribute_group *bnx2i_dev_groups[] = { + &bnx2i_dev_attr_group,NULL };
Bart Van Assche
maintainerPATCH v4 17/46 scsi: csiostor: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/csiostor/csio_scsi.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
drivers/scsi/csiostor/csio_scsi.c +14 -10
@@ -1460,14 +1460,16 @@ static DEVICE_ATTR(disable_port, S_IWUSR, NULL, csio_disable_port); static DEVICE_ATTR(dbg_level, S_IRUGO | S_IWUSR, csio_show_dbg_level, csio_store_dbg_level); -static struct device_attribute *csio_fcoe_lport_attrs[] = { - &dev_attr_hw_state, - &dev_attr_device_reset, - &dev_attr_disable_port, - &dev_attr_dbg_level, +static struct attribute *csio_fcoe_lport_attrs[] = { + &dev_attr_hw_state.attr, + &dev_attr_device_reset.attr, + &dev_attr_disable_port.attr, + &dev_attr_dbg_level.attr,NULL , }; +ATTRIBUTE_GROUPS (csio_fcoe_lport); +static ssize_t csio_show_num_reg_rnodes (struct device *dev,struct device_attribute *attr,char *buf)
@@ -1479,12 +1481,14 @@ csio_show_num_reg_rnodes(struct device *dev, static DEVICE_ATTR(num_reg_rnodes, S_IRUGO, csio_show_num_reg_rnodes, NULL); -static struct device_attribute *csio_fcoe_vport_attrs[] = { - &dev_attr_num_reg_rnodes, - &dev_attr_dbg_level, +static struct attribute *csio_fcoe_vport_attrs[] = { + &dev_attr_num_reg_rnodes.attr, + &dev_attr_dbg_level.attr,NULL , }; +ATTRIBUTE_GROUPS (csio_fcoe_vport); +static inline uint32_t csio_scsi_copy_to_sgl (struct csio_hw *hw,struct csio_ioreq *req) {
@@ -2277,7 +2281,7 @@ struct scsi_host_template csio_fcoe_shost_template = { .this_id = -1, .sg_tablesize = CSIO_SCSI_MAX_SGE, .cmd_per_lun = CSIO_MAX_CMD_PER_LUN, - .shost_attrs = csio_fcoe_lport_attrs, + .shost_groups = csio_fcoe_lport_groups, .max_sectors = CSIO_MAX_SECTOR_SIZE, };
@@ -2296,7 +2300,7 @@ struct scsi_host_template csio_fcoe_shost_vport_template = { .this_id = -1, .sg_tablesize = CSIO_SCSI_MAX_SGE, .cmd_per_lun = CSIO_MAX_CMD_PER_LUN, - .shost_attrs = csio_fcoe_vport_attrs, + .shost_groups = csio_fcoe_vport_groups, .max_sectors = CSIO_MAX_SECTOR_SIZE, };
Bart Van Assche
maintainerPATCH v4 18/46 scsi: cxlflash: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/cxlflash/main.c | 40 ++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 18 deletions(-)
drivers/scsi/cxlflash/main.c +22 -18
@@ -3103,33 +3103,37 @@ static DEVICE_ATTR_RW(irqpoll_weight);static DEVICE_ATTR_RW (num_hwqs);static DEVICE_ATTR_RW (hwq_mode); -static struct device_attribute *cxlflash_host_attrs[] = { - &dev_attr_port0, - &dev_attr_port1, - &dev_attr_port2, - &dev_attr_port3, - &dev_attr_lun_mode, - &dev_attr_ioctl_version, - &dev_attr_port0_lun_table, - &dev_attr_port1_lun_table, - &dev_attr_port2_lun_table, - &dev_attr_port3_lun_table, - &dev_attr_irqpoll_weight, - &dev_attr_num_hwqs, - &dev_attr_hwq_mode, +static struct attribute *cxlflash_host_attrs[] = { + &dev_attr_port0.attr, + &dev_attr_port1.attr, + &dev_attr_port2.attr, + &dev_attr_port3.attr, + &dev_attr_lun_mode.attr, + &dev_attr_ioctl_version.attr, + &dev_attr_port0_lun_table.attr, + &dev_attr_port1_lun_table.attr, + &dev_attr_port2_lun_table.attr, + &dev_attr_port3_lun_table.attr, + &dev_attr_irqpoll_weight.attr, + &dev_attr_num_hwqs.attr, + &dev_attr_hwq_mode.attr,NULL }; +ATTRIBUTE_GROUPS (cxlflash_host); +/* * Device attributes */ static DEVICE_ATTR_RO (mode); -static struct device_attribute *cxlflash_dev_attrs[] = { - &dev_attr_mode, +static struct attribute *cxlflash_dev_attrs[] = { + &dev_attr_mode.attr,NULL }; +ATTRIBUTE_GROUPS (cxlflash_dev); +/* * Host template */
@@ -3150,8 +3154,8 @@ static struct scsi_host_template driver_template = { .this_id = -1, .sg_tablesize = 1, /* No scatter gather support */ .max_sectors = CXLFLASH_MAX_SECTORS, - .shost_attrs = cxlflash_host_attrs, - .sdev_attrs = cxlflash_dev_attrs, + .shost_groups = cxlflash_host_groups, + .sdev_groups = cxlflash_dev_groups, };/*
Bart Van Assche
maintainerPATCH v4 19/46 scsi: fnic: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/fnic/fnic.h | 2 +- drivers/scsi/fnic/fnic_attrs.c | 17 +++++++++++++---- drivers/scsi/fnic/fnic_main.c | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-)
drivers/scsi/fnic/fnic.h +1 -1
@@ -322,7 +322,7 @@ static inline struct fnic *fnic_from_ctlr(struct fcoe_ctlr *fip)extern struct workqueue_struct *fnic_event_queue;extern struct workqueue_struct *fnic_fip_queue; -extern struct device_attribute *fnic_attrs[]; +extern const struct attribute_group *fnic_host_groups[];void fnic_clear_intr_mode (struct fnic *fnic);int fnic_set_intr_mode (struct fnic *fnic);
drivers/scsi/fnic/fnic_attrs.c +13 -4
@@ -48,9 +48,18 @@ static DEVICE_ATTR(fnic_state, S_IRUGO, fnic_show_state, NULL); static DEVICE_ATTR(drv_version, S_IRUGO, fnic_show_drv_version, NULL); static DEVICE_ATTR(link_state, S_IRUGO, fnic_show_link_state, NULL); -struct device_attribute *fnic_attrs[] = { - &dev_attr_fnic_state, - &dev_attr_drv_version, - &dev_attr_link_state, +static struct attribute *fnic_host_attrs[] = { + &dev_attr_fnic_state.attr, + &dev_attr_drv_version.attr, + &dev_attr_link_state.attr,NULL , }; + +static const struct attribute_group fnic_host_attr_group = { + .attrs = fnic_host_attrs +}; + +const struct attribute_group *fnic_host_groups[] = { + &fnic_host_attr_group, +NULL +};
drivers/scsi/fnic/fnic_main.c +1 -1
@@ -122,7 +122,7 @@ static struct scsi_host_template fnic_host_template = { .can_queue = FNIC_DFLT_IO_REQ, .sg_tablesize = FNIC_MAX_SG_DESC_CNT, .max_sectors = 0xffff, - .shost_attrs = fnic_attrs, + .shost_groups = fnic_host_groups, .track_queue_depth = 1, };
Bart Van Assche
maintainerPATCH v4 20/46 scsi: hisi_sas: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 8 +++++--- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 8 +++++--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 14 ++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-)
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +5 -3
@@ -1749,11 +1749,13 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba)return 0 ; } -static struct device_attribute *host_attrs_v1_hw[] = { - &dev_attr_phy_event_threshold, +static struct attribute *host_v1_hw_attrs[] = { + &dev_attr_phy_event_threshold.attr,NULL }; +ATTRIBUTE_GROUPS (host_v1_hw); +static struct scsi_host_template sht_v1_hw = { .name =DRV_NAME , .proc_name =DRV_NAME ,
@@ -1777,7 +1779,7 @@ static struct scsi_host_template sht_v1_hw = {#ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = host_attrs_v1_hw, + .shost_groups = host_v1_hw_groups, .host_reset = hisi_sas_host_reset, };
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +5 -3
@@ -3542,11 +3542,13 @@ static void wait_cmds_complete_timeout_v2_hw(struct hisi_hba *hisi_hba, } -static struct device_attribute *host_attrs_v2_hw[] = { - &dev_attr_phy_event_threshold, +static struct attribute *host_v2_hw_attrs[] = { + &dev_attr_phy_event_threshold.attr,NULL }; +ATTRIBUTE_GROUPS (host_v2_hw); +static int map_queues_v2_hw (struct Scsi_Host *shost) {struct hisi_hba *hisi_hba =shost_priv (shost);
@@ -3590,7 +3592,7 @@ static struct scsi_host_template sht_v2_hw = {#ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = host_attrs_v2_hw, + .shost_groups = host_v2_hw_groups, .host_reset = hisi_sas_host_reset, .map_queues = map_queues_v2_hw, .host_tagset = 1,
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +8 -6
@@ -2771,14 +2771,16 @@ static int slave_configure_v3_hw(struct scsi_device *sdev)return 0 ; } -static struct device_attribute *host_attrs_v3_hw[] = { - &dev_attr_phy_event_threshold, - &dev_attr_intr_conv_v3_hw, - &dev_attr_intr_coal_ticks_v3_hw, - &dev_attr_intr_coal_count_v3_hw, +static struct attribute *host_v3_hw_attrs[] = { + &dev_attr_phy_event_threshold.attr, + &dev_attr_intr_conv_v3_hw.attr, + &dev_attr_intr_coal_ticks_v3_hw.attr, + &dev_attr_intr_coal_count_v3_hw.attr,NULL }; +ATTRIBUTE_GROUPS (host_v3_hw); +#define HISI_SAS_DEBUGFS_REG (x) {#x, x}struct hisi_sas_debugfs_reg_lu {
@@ -3163,7 +3165,7 @@ static struct scsi_host_template sht_v3_hw = {#ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = host_attrs_v3_hw, + .shost_groups = host_v3_hw_groups, .tag_alloc_policy = BLK_TAG_ALLOC_RR, .host_reset = hisi_sas_host_reset, .host_tagset = 1,
Re: [PATCH v4 20/46] scsi: hisi_sas: Switch to attribute groups
Quoted 4 lines · Bart Van Assche
struct device supports attribute groups directly but does not support struct
device_attributedirectly. Hence switch to attribute groups.Signed-off-by Bart Van Assche<[email protected]>
Bart Van Assche
maintainerPATCH v4 21/46 scsi: hpsa: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/hpsa.c | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-)
drivers/scsi/hpsa.c +24 -20
@@ -936,30 +936,34 @@ static DEVICE_ATTR(ctlr_num, S_IRUGO, static DEVICE_ATTR(legacy_board, S_IRUGO, host_show_legacy_board, NULL); -static struct device_attribute *hpsa_sdev_attrs[] = { - &dev_attr_raid_level, - &dev_attr_lunid, - &dev_attr_unique_id, - &dev_attr_hp_ssd_smart_path_enabled, - &dev_attr_path_info, - &dev_attr_sas_address, +static struct attribute *hpsa_sdev_attrs[] = { + &dev_attr_raid_level.attr, + &dev_attr_lunid.attr, + &dev_attr_unique_id.attr, + &dev_attr_hp_ssd_smart_path_enabled.attr, + &dev_attr_path_info.attr, + &dev_attr_sas_address.attr,NULL , }; -static struct device_attribute *hpsa_shost_attrs[] = { - &dev_attr_rescan, - &dev_attr_firmware_revision, - &dev_attr_commands_outstanding, - &dev_attr_transport_mode, - &dev_attr_resettable, - &dev_attr_hp_ssd_smart_path_status, - &dev_attr_raid_offload_debug, - &dev_attr_lockup_detected, - &dev_attr_ctlr_num, - &dev_attr_legacy_board, +ATTRIBUTE_GROUPS (hpsa_sdev); + +static struct attribute *hpsa_shost_attrs[] = { + &dev_attr_rescan.attr, + &dev_attr_firmware_revision.attr, + &dev_attr_commands_outstanding.attr, + &dev_attr_transport_mode.attr, + &dev_attr_resettable.attr, + &dev_attr_hp_ssd_smart_path_status.attr, + &dev_attr_raid_offload_debug.attr, + &dev_attr_lockup_detected.attr, + &dev_attr_ctlr_num.attr, + &dev_attr_legacy_board.attr,NULL , }; +ATTRIBUTE_GROUPS (hpsa_shost); +#define HPSA_NRESERVED_CMDS (HPSA_CMDS_RESERVED_FOR_DRIVER +\ HPSA_MAX_CONCURRENT_PASSTHRUS)
@@ -980,8 +984,8 @@ static struct scsi_host_template hpsa_driver_template = {#ifdef CONFIG_COMPAT .compat_ioctl = hpsa_compat_ioctl, #endif - .sdev_attrs = hpsa_sdev_attrs, - .shost_attrs = hpsa_shost_attrs, + .sdev_groups = hpsa_sdev_groups, + .shost_groups = hpsa_shost_groups, .max_sectors = 2048, .no_write_same = 1, };
Bart Van Assche
maintainerPATCH v4 22/46 scsi: hptiop: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/hptiop.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/scsi/hptiop.c +6 -4
@@ -1150,12 +1150,14 @@ static struct device_attribute hptiop_attr_fw_version = { .show = hptiop_show_fw_version, }; -static struct device_attribute *hptiop_attrs[] = { - &hptiop_attr_version, - &hptiop_attr_fw_version, +static struct attribute *hptiop_host_attrs[] = { + &hptiop_attr_version.attr, + &hptiop_attr_fw_version.attr,NULL }; +ATTRIBUTE_GROUPS (hptiop_host); +static int hptiop_slave_config (struct scsi_device *sdev) {if (sdev->type ==TYPE_TAPE )
@@ -1172,7 +1174,7 @@ static struct scsi_host_template driver_template = { .info = hptiop_info, .emulated = 0, .proc_name = driver_name, - .shost_attrs = hptiop_attrs, + .shost_groups = hptiop_host_groups, .slave_configure = hptiop_slave_config, .this_id = -1, .change_queue_depth = hptiop_adjust_disk_queue_depth,
Bart Van Assche
maintainerPATCH v4 23/46 scsi: ibmvscsi: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/ibmvscsi/ibmvscsi.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/scsi/ibmvscsi/ibmvscsi.c +12 -10
@@ -2064,18 +2064,20 @@ static int ibmvscsi_host_reset(struct Scsi_Host *shost, int reset_type)return 0 ; } -static struct device_attribute *ibmvscsi_attrs[] = { - &ibmvscsi_host_vhost_loc, - &ibmvscsi_host_vhost_name, - &ibmvscsi_host_srp_version, - &ibmvscsi_host_partition_name, - &ibmvscsi_host_partition_number, - &ibmvscsi_host_mad_version, - &ibmvscsi_host_os_type, - &ibmvscsi_host_config, +static struct attribute *ibmvscsi_host_attrs[] = { + &ibmvscsi_host_vhost_loc.attr, + &ibmvscsi_host_vhost_name.attr, + &ibmvscsi_host_srp_version.attr, + &ibmvscsi_host_partition_name.attr, + &ibmvscsi_host_partition_number.attr, + &ibmvscsi_host_mad_version.attr, + &ibmvscsi_host_os_type.attr, + &ibmvscsi_host_config.attr,NULL }; +ATTRIBUTE_GROUPS (ibmvscsi_host); +/* ------------------------------------------------------------ * SCSI driver registration */
@@ -2095,7 +2097,7 @@ static struct scsi_host_template driver_template = { .can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT, .this_id = -1, .sg_tablesize = SG_ALL, - .shost_attrs = ibmvscsi_attrs, + .shost_groups = ibmvscsi_host_groups, };/**
Re: [PATCH v4 23/46] scsi: ibmvscsi: Switch to attribute groups
Quoted 5 lines · Bart Van Assche
struct device supports attribute groups directly but does not support struct
device_attributedirectly. Hence switch to attribute groups.Signed-off-by Bart Van Assche <[email protected]>---
Bart Van Assche
maintainerPATCH v4 24/46 scsi: ibmvfc: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/ibmvscsi/ibmvfc.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/scsi/ibmvscsi/ibmvfc.c +12 -10
@@ -3588,18 +3588,20 @@ static struct bin_attribute ibmvfc_trace_attr = { };#endif -static struct device_attribute *ibmvfc_attrs[] = { - &dev_attr_partition_name, - &dev_attr_device_name, - &dev_attr_port_loc_code, - &dev_attr_drc_name, - &dev_attr_npiv_version, - &dev_attr_capabilities, - &dev_attr_log_level, - &dev_attr_nr_scsi_channels, +static struct attribute *ibmvfc_host_attrs[] = { + &dev_attr_partition_name.attr, + &dev_attr_device_name.attr, + &dev_attr_port_loc_code.attr, + &dev_attr_drc_name.attr, + &dev_attr_npiv_version.attr, + &dev_attr_capabilities.attr, + &dev_attr_log_level.attr, + &dev_attr_nr_scsi_channels.attr,NULL }; +ATTRIBUTE_GROUPS (ibmvfc_host); +static struct scsi_host_template driver_template = { .module =THIS_MODULE , .name ="IBM POWER Virtual FC Adapter" ,
@@ -3620,7 +3622,7 @@ static struct scsi_host_template driver_template = { .this_id = -1, .sg_tablesize = SG_ALL, .max_sectors = IBMVFC_MAX_SECTORS, - .shost_attrs = ibmvfc_attrs, + .shost_groups = ibmvfc_host_groups, .track_queue_depth = 1, .host_tagset = 1, };
Re: [PATCH v4 24/46] scsi: ibmvfc: Switch to attribute groups
Quoted 5 lines · Bart Van Assche
struct device supports attribute groups directly but does not support struct
device_attributedirectly. Hence switch to attribute groups.Signed-off-by Bart Van Assche <[email protected]>---
Bart Van Assche
maintainerPATCH v4 25/46 scsi: ipr: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/ipr.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-)
drivers/scsi/ipr.c +21 -17
@@ -4236,18 +4236,20 @@ static struct bin_attribute ipr_ioa_async_err_log = { .write = ipr_next_async_err_log }; -static struct device_attribute *ipr_ioa_attrs[] = { - &ipr_fw_version_attr, - &ipr_log_level_attr, - &ipr_diagnostics_attr, - &ipr_ioa_state_attr, - &ipr_ioa_reset_attr, - &ipr_update_fw_attr, - &ipr_ioa_fw_type_attr, - &ipr_iopoll_weight_attr, +static struct attribute *ipr_ioa_attrs[] = { + &ipr_fw_version_attr.attr, + &ipr_log_level_attr.attr, + &ipr_diagnostics_attr.attr, + &ipr_ioa_state_attr.attr, + &ipr_ioa_reset_attr.attr, + &ipr_update_fw_attr.attr, + &ipr_ioa_fw_type_attr.attr, + &ipr_iopoll_weight_attr.attr,NULL , }; +ATTRIBUTE_GROUPS (ipr_ioa); +#ifdef CONFIG_SCSI_IPR_DUMP /** * ipr_read_dump - Dump the adapter
@@ -4732,15 +4734,17 @@ static struct device_attribute ipr_raw_mode_attr = { .store = ipr_store_raw_mode }; -static struct device_attribute *ipr_dev_attrs[] = { - &ipr_adapter_handle_attr, - &ipr_resource_path_attr, - &ipr_device_id_attr, - &ipr_resource_type_attr, - &ipr_raw_mode_attr, +static struct attribute *ipr_dev_attrs[] = { + &ipr_adapter_handle_attr.attr, + &ipr_resource_path_attr.attr, + &ipr_device_id_attr.attr, + &ipr_resource_type_attr.attr, + &ipr_raw_mode_attr.attr,NULL , }; +ATTRIBUTE_GROUPS (ipr_dev); +/** * ipr_biosparam - Return the HSC mapping * @sdev: scsi device struct
@@ -6762,8 +6766,8 @@ static struct scsi_host_template driver_template = { .sg_tablesize = IPR_MAX_SGLIST, .max_sectors = IPR_IOA_MAX_SECTORS, .cmd_per_lun = IPR_MAX_CMD_PER_LUN, - .shost_attrs = ipr_ioa_attrs, - .sdev_attrs = ipr_dev_attrs, + .shost_groups = ipr_ioa_groups, + .sdev_groups = ipr_dev_groups, .proc_name = IPR_NAME, };
Bart Van Assche
maintainerPATCH v4 26/46 scsi: isci: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/isci/init.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/isci/init.c +5 -3
@@ -142,11 +142,13 @@ static ssize_t isci_show_id(struct device *dev, struct device_attribute *attr, c static DEVICE_ATTR(isci_id, S_IRUGO, isci_show_id, NULL); -static struct device_attribute *isci_host_attrs[] = { - &dev_attr_isci_id, +static struct attribute *isci_host_attrs[] = { + &dev_attr_isci_id.attr,NULL }; +ATTRIBUTE_GROUPS (isci_host); +static struct scsi_host_template isci_sht = { .module =THIS_MODULE ,
@@ -173,7 +175,7 @@ static struct scsi_host_template isci_sht = {#ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = isci_host_attrs, + .shost_groups = isci_host_groups, .track_queue_depth = 1, };
Bart Van Assche
maintainerPATCH v4 27/46 scsi: lpfc: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/lpfc/lpfc_attr.c | 314 ++++++++++++++++++---------------- drivers/scsi/lpfc/lpfc_crtn.h | 4 +- drivers/scsi/lpfc/lpfc_init.c | 2 +- drivers/scsi/lpfc/lpfc_scsi.c | 4 +- 4 files changed, 171 insertions(+), 153 deletions(-)
drivers/scsi/lpfc/lpfc_attr.c +166 -148
@@ -6396,160 +6396,178 @@ LPFC_ATTR_RW(vmid_priority_tagging, LPFC_VMID_PRIO_TAG_DISABLE,LPFC_VMID_PRIO_TAG_ALL_TARGETS , "Enable Priority Tagging VMID support"); -struct device_attribute *lpfc_hba_attrs[] = { - &dev_attr_nvme_info, - &dev_attr_scsi_stat, - &dev_attr_bg_info, - &dev_attr_bg_guard_err, - &dev_attr_bg_apptag_err, - &dev_attr_bg_reftag_err, - &dev_attr_info, - &dev_attr_serialnum, - &dev_attr_modeldesc, - &dev_attr_modelname, - &dev_attr_programtype, - &dev_attr_portnum, - &dev_attr_fwrev, - &dev_attr_hdw, - &dev_attr_option_rom_version, - &dev_attr_link_state, - &dev_attr_num_discovered_ports, - &dev_attr_menlo_mgmt_mode, - &dev_attr_lpfc_drvr_version, - &dev_attr_lpfc_enable_fip, - &dev_attr_lpfc_temp_sensor, - &dev_attr_lpfc_log_verbose, - &dev_attr_lpfc_lun_queue_depth, - &dev_attr_lpfc_tgt_queue_depth, - &dev_attr_lpfc_hba_queue_depth, - &dev_attr_lpfc_peer_port_login, - &dev_attr_lpfc_nodev_tmo, - &dev_attr_lpfc_devloss_tmo, - &dev_attr_lpfc_enable_fc4_type, - &dev_attr_lpfc_fcp_class, - &dev_attr_lpfc_use_adisc, - &dev_attr_lpfc_first_burst_size, - &dev_attr_lpfc_ack0, - &dev_attr_lpfc_xri_rebalancing, - &dev_attr_lpfc_topology, - &dev_attr_lpfc_scan_down, - &dev_attr_lpfc_link_speed, - &dev_attr_lpfc_fcp_io_sched, - &dev_attr_lpfc_ns_query, - &dev_attr_lpfc_fcp2_no_tgt_reset, - &dev_attr_lpfc_cr_delay, - &dev_attr_lpfc_cr_count, - &dev_attr_lpfc_multi_ring_support, - &dev_attr_lpfc_multi_ring_rctl, - &dev_attr_lpfc_multi_ring_type, - &dev_attr_lpfc_fdmi_on, - &dev_attr_lpfc_enable_SmartSAN, - &dev_attr_lpfc_max_luns, - &dev_attr_lpfc_enable_npiv, - &dev_attr_lpfc_fcf_failover_policy, - &dev_attr_lpfc_enable_rrq, - &dev_attr_lpfc_fcp_wait_abts_rsp, - &dev_attr_nport_evt_cnt, - &dev_attr_board_mode, - &dev_attr_max_vpi, - &dev_attr_used_vpi, - &dev_attr_max_rpi, - &dev_attr_used_rpi, - &dev_attr_max_xri, - &dev_attr_used_xri, - &dev_attr_npiv_info, - &dev_attr_issue_reset, - &dev_attr_lpfc_poll, - &dev_attr_lpfc_poll_tmo, - &dev_attr_lpfc_task_mgmt_tmo, - &dev_attr_lpfc_use_msi, - &dev_attr_lpfc_nvme_oas, - &dev_attr_lpfc_nvme_embed_cmd, - &dev_attr_lpfc_fcp_imax, - &dev_attr_lpfc_force_rscn, - &dev_attr_lpfc_cq_poll_threshold, - &dev_attr_lpfc_cq_max_proc_limit, - &dev_attr_lpfc_fcp_cpu_map, - &dev_attr_lpfc_fcp_mq_threshold, - &dev_attr_lpfc_hdw_queue, - &dev_attr_lpfc_irq_chann, - &dev_attr_lpfc_suppress_rsp, - &dev_attr_lpfc_nvmet_mrq, - &dev_attr_lpfc_nvmet_mrq_post, - &dev_attr_lpfc_nvme_enable_fb, - &dev_attr_lpfc_nvmet_fb_size, - &dev_attr_lpfc_enable_bg, - &dev_attr_lpfc_soft_wwnn, - &dev_attr_lpfc_soft_wwpn, - &dev_attr_lpfc_soft_wwn_enable, - &dev_attr_lpfc_enable_hba_reset, - &dev_attr_lpfc_enable_hba_heartbeat, - &dev_attr_lpfc_EnableXLane, - &dev_attr_lpfc_XLanePriority, - &dev_attr_lpfc_xlane_lun, - &dev_attr_lpfc_xlane_tgt, - &dev_attr_lpfc_xlane_vpt, - &dev_attr_lpfc_xlane_lun_state, - &dev_attr_lpfc_xlane_lun_status, - &dev_attr_lpfc_xlane_priority, - &dev_attr_lpfc_sg_seg_cnt, - &dev_attr_lpfc_max_scsicmpl_time, - &dev_attr_lpfc_stat_data_ctrl, - &dev_attr_lpfc_aer_support, - &dev_attr_lpfc_aer_state_cleanup, - &dev_attr_lpfc_sriov_nr_virtfn, - &dev_attr_lpfc_req_fw_upgrade, - &dev_attr_lpfc_suppress_link_up, - &dev_attr_iocb_hw, - &dev_attr_pls, - &dev_attr_pt, - &dev_attr_txq_hw, - &dev_attr_txcmplq_hw, - &dev_attr_lpfc_sriov_hw_max_virtfn, - &dev_attr_protocol, - &dev_attr_lpfc_xlane_supported, - &dev_attr_lpfc_enable_mds_diags, - &dev_attr_lpfc_ras_fwlog_buffsize, - &dev_attr_lpfc_ras_fwlog_level, - &dev_attr_lpfc_ras_fwlog_func, - &dev_attr_lpfc_enable_bbcr, - &dev_attr_lpfc_enable_dpp, - &dev_attr_lpfc_enable_mi, - &dev_attr_cmf_info, - &dev_attr_lpfc_max_vmid, - &dev_attr_lpfc_vmid_inactivity_timeout, - &dev_attr_lpfc_vmid_app_header, - &dev_attr_lpfc_vmid_priority_tagging, +static struct attribute *lpfc_hba_attrs[] = { + &dev_attr_nvme_info.attr, + &dev_attr_scsi_stat.attr, + &dev_attr_bg_info.attr, + &dev_attr_bg_guard_err.attr, + &dev_attr_bg_apptag_err.attr, + &dev_attr_bg_reftag_err.attr, + &dev_attr_info.attr, + &dev_attr_serialnum.attr, + &dev_attr_modeldesc.attr, + &dev_attr_modelname.attr, + &dev_attr_programtype.attr, + &dev_attr_portnum.attr, + &dev_attr_fwrev.attr, + &dev_attr_hdw.attr, + &dev_attr_option_rom_version.attr, + &dev_attr_link_state.attr, + &dev_attr_num_discovered_ports.attr, + &dev_attr_menlo_mgmt_mode.attr, + &dev_attr_lpfc_drvr_version.attr, + &dev_attr_lpfc_enable_fip.attr, + &dev_attr_lpfc_temp_sensor.attr, + &dev_attr_lpfc_log_verbose.attr, + &dev_attr_lpfc_lun_queue_depth.attr, + &dev_attr_lpfc_tgt_queue_depth.attr, + &dev_attr_lpfc_hba_queue_depth.attr, + &dev_attr_lpfc_peer_port_login.attr, + &dev_attr_lpfc_nodev_tmo.attr, + &dev_attr_lpfc_devloss_tmo.attr, + &dev_attr_lpfc_enable_fc4_type.attr, + &dev_attr_lpfc_fcp_class.attr, + &dev_attr_lpfc_use_adisc.attr, + &dev_attr_lpfc_first_burst_size.attr, + &dev_attr_lpfc_ack0.attr, + &dev_attr_lpfc_xri_rebalancing.attr, + &dev_attr_lpfc_topology.attr, + &dev_attr_lpfc_scan_down.attr, + &dev_attr_lpfc_link_speed.attr, + &dev_attr_lpfc_fcp_io_sched.attr, + &dev_attr_lpfc_ns_query.attr, + &dev_attr_lpfc_fcp2_no_tgt_reset.attr, + &dev_attr_lpfc_cr_delay.attr, + &dev_attr_lpfc_cr_count.attr, + &dev_attr_lpfc_multi_ring_support.attr, + &dev_attr_lpfc_multi_ring_rctl.attr, + &dev_attr_lpfc_multi_ring_type.attr, + &dev_attr_lpfc_fdmi_on.attr, + &dev_attr_lpfc_enable_SmartSAN.attr, + &dev_attr_lpfc_max_luns.attr, + &dev_attr_lpfc_enable_npiv.attr, + &dev_attr_lpfc_fcf_failover_policy.attr, + &dev_attr_lpfc_enable_rrq.attr, + &dev_attr_lpfc_fcp_wait_abts_rsp.attr, + &dev_attr_nport_evt_cnt.attr, + &dev_attr_board_mode.attr, + &dev_attr_max_vpi.attr, + &dev_attr_used_vpi.attr, + &dev_attr_max_rpi.attr, + &dev_attr_used_rpi.attr, + &dev_attr_max_xri.attr, + &dev_attr_used_xri.attr, + &dev_attr_npiv_info.attr, + &dev_attr_issue_reset.attr, + &dev_attr_lpfc_poll.attr, + &dev_attr_lpfc_poll_tmo.attr, + &dev_attr_lpfc_task_mgmt_tmo.attr, + &dev_attr_lpfc_use_msi.attr, + &dev_attr_lpfc_nvme_oas.attr, + &dev_attr_lpfc_nvme_embed_cmd.attr, + &dev_attr_lpfc_fcp_imax.attr, + &dev_attr_lpfc_force_rscn.attr, + &dev_attr_lpfc_cq_poll_threshold.attr, + &dev_attr_lpfc_cq_max_proc_limit.attr, + &dev_attr_lpfc_fcp_cpu_map.attr, + &dev_attr_lpfc_fcp_mq_threshold.attr, + &dev_attr_lpfc_hdw_queue.attr, + &dev_attr_lpfc_irq_chann.attr, + &dev_attr_lpfc_suppress_rsp.attr, + &dev_attr_lpfc_nvmet_mrq.attr, + &dev_attr_lpfc_nvmet_mrq_post.attr, + &dev_attr_lpfc_nvme_enable_fb.attr, + &dev_attr_lpfc_nvmet_fb_size.attr, + &dev_attr_lpfc_enable_bg.attr, + &dev_attr_lpfc_soft_wwnn.attr, + &dev_attr_lpfc_soft_wwpn.attr, + &dev_attr_lpfc_soft_wwn_enable.attr, + &dev_attr_lpfc_enable_hba_reset.attr, + &dev_attr_lpfc_enable_hba_heartbeat.attr, + &dev_attr_lpfc_EnableXLane.attr, + &dev_attr_lpfc_XLanePriority.attr, + &dev_attr_lpfc_xlane_lun.attr, + &dev_attr_lpfc_xlane_tgt.attr, + &dev_attr_lpfc_xlane_vpt.attr, + &dev_attr_lpfc_xlane_lun_state.attr, + &dev_attr_lpfc_xlane_lun_status.attr, + &dev_attr_lpfc_xlane_priority.attr, + &dev_attr_lpfc_sg_seg_cnt.attr, + &dev_attr_lpfc_max_scsicmpl_time.attr, + &dev_attr_lpfc_stat_data_ctrl.attr, + &dev_attr_lpfc_aer_support.attr, + &dev_attr_lpfc_aer_state_cleanup.attr, + &dev_attr_lpfc_sriov_nr_virtfn.attr, + &dev_attr_lpfc_req_fw_upgrade.attr, + &dev_attr_lpfc_suppress_link_up.attr, + &dev_attr_iocb_hw.attr, + &dev_attr_pls.attr, + &dev_attr_pt.attr, + &dev_attr_txq_hw.attr, + &dev_attr_txcmplq_hw.attr, + &dev_attr_lpfc_sriov_hw_max_virtfn.attr, + &dev_attr_protocol.attr, + &dev_attr_lpfc_xlane_supported.attr, + &dev_attr_lpfc_enable_mds_diags.attr, + &dev_attr_lpfc_ras_fwlog_buffsize.attr, + &dev_attr_lpfc_ras_fwlog_level.attr, + &dev_attr_lpfc_ras_fwlog_func.attr, + &dev_attr_lpfc_enable_bbcr.attr, + &dev_attr_lpfc_enable_dpp.attr, + &dev_attr_lpfc_enable_mi.attr, + &dev_attr_cmf_info.attr, + &dev_attr_lpfc_max_vmid.attr, + &dev_attr_lpfc_vmid_inactivity_timeout.attr, + &dev_attr_lpfc_vmid_app_header.attr, + &dev_attr_lpfc_vmid_priority_tagging.attr,NULL , }; -struct device_attribute *lpfc_vport_attrs[] = { - &dev_attr_info, - &dev_attr_link_state, - &dev_attr_num_discovered_ports, - &dev_attr_lpfc_drvr_version, - &dev_attr_lpfc_log_verbose, - &dev_attr_lpfc_lun_queue_depth, - &dev_attr_lpfc_tgt_queue_depth, - &dev_attr_lpfc_nodev_tmo, - &dev_attr_lpfc_devloss_tmo, - &dev_attr_lpfc_hba_queue_depth, - &dev_attr_lpfc_peer_port_login, - &dev_attr_lpfc_restrict_login, - &dev_attr_lpfc_fcp_class, - &dev_attr_lpfc_use_adisc, - &dev_attr_lpfc_first_burst_size, - &dev_attr_lpfc_max_luns, - &dev_attr_nport_evt_cnt, - &dev_attr_npiv_info, - &dev_attr_lpfc_enable_da_id, - &dev_attr_lpfc_max_scsicmpl_time, - &dev_attr_lpfc_stat_data_ctrl, - &dev_attr_lpfc_static_vport, - &dev_attr_cmf_info, +static const struct attribute_group lpfc_hba_attr_group = { + .attrs = lpfc_hba_attrs +}; + +const struct attribute_group *lpfc_hba_groups[] = { + &lpfc_hba_attr_group, +NULL +}; + +static struct attribute *lpfc_vport_attrs[] = { + &dev_attr_info.attr, + &dev_attr_link_state.attr, + &dev_attr_num_discovered_ports.attr, + &dev_attr_lpfc_drvr_version.attr, + &dev_attr_lpfc_log_verbose.attr, + &dev_attr_lpfc_lun_queue_depth.attr, + &dev_attr_lpfc_tgt_queue_depth.attr, + &dev_attr_lpfc_nodev_tmo.attr, + &dev_attr_lpfc_devloss_tmo.attr, + &dev_attr_lpfc_hba_queue_depth.attr, + &dev_attr_lpfc_peer_port_login.attr, + &dev_attr_lpfc_restrict_login.attr, + &dev_attr_lpfc_fcp_class.attr, + &dev_attr_lpfc_use_adisc.attr, + &dev_attr_lpfc_first_burst_size.attr, + &dev_attr_lpfc_max_luns.attr, + &dev_attr_nport_evt_cnt.attr, + &dev_attr_npiv_info.attr, + &dev_attr_lpfc_enable_da_id.attr, + &dev_attr_lpfc_max_scsicmpl_time.attr, + &dev_attr_lpfc_stat_data_ctrl.attr, + &dev_attr_lpfc_static_vport.attr, + &dev_attr_cmf_info.attr,NULL , }; +static const struct attribute_group lpfc_vport_attr_group = { + .attrs = lpfc_vport_attrs +}; + +const struct attribute_group *lpfc_vport_groups[] = { + &lpfc_vport_attr_group, +NULL +}; +/** * sysfs_ctlreg_write - Write method for writing to ctlreg * @filp: open sysfs file
drivers/scsi/lpfc/lpfc_crtn.h +2 -2
@@ -428,8 +428,8 @@ void lpfc_get_cfgparam(struct lpfc_hba *);void lpfc_get_vport_cfgparam (struct lpfc_vport *);int lpfc_alloc_sysfs_attr (struct lpfc_vport *);void lpfc_free_sysfs_attr (struct lpfc_vport *); -extern struct device_attribute *lpfc_hba_attrs[]; -extern struct device_attribute *lpfc_vport_attrs[]; +extern const struct attribute_group *lpfc_hba_groups[]; +extern const struct attribute_group *lpfc_vport_groups[];extern struct scsi_host_template lpfc_template;extern struct scsi_host_template lpfc_template_nvme;extern struct fc_function_template lpfc_transport_functions;
drivers/scsi/lpfc/lpfc_init.c +1 -1
@@ -4574,7 +4574,7 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev)/* Template for all vports this physical port creates */ memcpy (&phba->vport_template, &lpfc_template,sizeof (*template)); - phba->vport_template.shost_attrs = lpfc_vport_attrs; + phba->vport_template.shost_groups = lpfc_vport_groups; phba->vport_template.eh_bus_reset_handler =NULL ; phba->vport_template.eh_host_reset_handler =NULL ; phba->vport_template.vendor_id =0 ;
drivers/scsi/lpfc/lpfc_scsi.c +2 -2
@@ -7203,7 +7203,7 @@ struct scsi_host_template lpfc_template_nvme = { .this_id = -1, .sg_tablesize = 1, .cmd_per_lun = 1, - .shost_attrs = lpfc_hba_attrs, + .shost_groups = lpfc_hba_groups, .max_sectors = 0xFFFFFFFF, .vendor_id = LPFC_NL_VENDOR_ID, .track_queue_depth = 0,
@@ -7229,7 +7229,7 @@ struct scsi_host_template lpfc_template = { .this_id = -1, .sg_tablesize = LPFC_DEFAULT_SG_SEG_CNT, .cmd_per_lun = LPFC_CMD_PER_LUN, - .shost_attrs = lpfc_hba_attrs, + .shost_groups = lpfc_hba_groups, .max_sectors = 0xFFFFFFFF, .vendor_id = LPFC_NL_VENDOR_ID, .change_queue_depth = scsi_change_queue_depth,
Bart Van Assche
maintainerPATCH v4 28/46 scsi: megaraid: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/megaraid/megaraid_mbox.c | 15 ++++++++------ drivers/scsi/megaraid/megaraid_sas_base.c | 24 ++++++++++++----------- 2 files changed, 22 insertions(+), 17 deletions(-)
drivers/scsi/megaraid/megaraid_mbox.c +9 -6
@@ -305,20 +305,23 @@ static struct pci_driver megaraid_pci_driver = {static DEVICE_ATTR_ADMIN_RO (megaraid_mbox_app_hndl);// Host template initializer for megaraid mbox sysfs device attributes -static struct device_attribute *megaraid_shost_attrs[] = { - &dev_attr_megaraid_mbox_app_hndl, +static struct attribute *megaraid_shost_attrs[] = { + &dev_attr_megaraid_mbox_app_hndl.attr,NULL , }; +ATTRIBUTE_GROUPS (megaraid_shost);static DEVICE_ATTR_ADMIN_RO (megaraid_mbox_ld);// Host template initializer for megaraid mbox sysfs device attributes -static struct device_attribute *megaraid_sdev_attrs[] = { - &dev_attr_megaraid_mbox_ld, +static struct attribute *megaraid_sdev_attrs[] = { + &dev_attr_megaraid_mbox_ld.attr,NULL , }; +ATTRIBUTE_GROUPS (megaraid_sdev); +/* * Scsi host template for megaraid unified driver */
@@ -331,8 +334,8 @@ static struct scsi_host_template megaraid_template_g = { .eh_host_reset_handler = megaraid_reset_handler, .change_queue_depth = scsi_change_queue_depth, .no_write_same = 1, - .sdev_attrs = megaraid_sdev_attrs, - .shost_attrs = megaraid_shost_attrs, + .sdev_groups = megaraid_sdev_groups, + .shost_groups = megaraid_shost_groups, };
drivers/scsi/megaraid/megaraid_sas_base.c +13 -11
@@ -3481,19 +3481,21 @@ static DEVICE_ATTR_RW(enable_sdev_max_qd);static DEVICE_ATTR_RO (dump_system_regs);static DEVICE_ATTR_RO (raid_map_id); -static struct device_attribute *megaraid_host_attrs[] = { - &dev_attr_fw_crash_buffer_size, - &dev_attr_fw_crash_buffer, - &dev_attr_fw_crash_state, - &dev_attr_page_size, - &dev_attr_ldio_outstanding, - &dev_attr_fw_cmds_outstanding, - &dev_attr_enable_sdev_max_qd, - &dev_attr_dump_system_regs, - &dev_attr_raid_map_id, +static struct attribute *megaraid_host_attrs[] = { + &dev_attr_fw_crash_buffer_size.attr, + &dev_attr_fw_crash_buffer.attr, + &dev_attr_fw_crash_state.attr, + &dev_attr_page_size.attr, + &dev_attr_ldio_outstanding.attr, + &dev_attr_fw_cmds_outstanding.attr, + &dev_attr_enable_sdev_max_qd.attr, + &dev_attr_dump_system_regs.attr, + &dev_attr_raid_map_id.attr,NULL , }; +ATTRIBUTE_GROUPS (megaraid_host); +/* * Scsi host template for megaraid_sas driver */
@@ -3510,7 +3512,7 @@ static struct scsi_host_template megasas_template = { .eh_abort_handler = megasas_task_abort, .eh_host_reset_handler = megasas_reset_bus_host, .eh_timed_out = megasas_reset_timer, - .shost_attrs = megaraid_host_attrs, + .shost_groups = megaraid_host_groups, .bios_param = megasas_bios_param, .map_queues = megasas_map_queues, .mq_poll = megasas_blk_mq_poll,
Bart Van Assche
maintainerPATCH v4 29/46 scsi: mpt3sas: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/mpt3sas/mpt3sas_base.h | 4 +- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 84 +++++++++++++++++----------- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 8 +-- 3 files changed, 57 insertions(+), 39 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_base.h +2 -2
@@ -1939,8 +1939,8 @@ mpt3sas_config_update_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc, struct SL_WH_MPI_TRIGGERS_T *mpi_tg, bool set);/* ctl shared API */ -extern struct device_attribute *mpt3sas_host_attrs[]; -extern struct device_attribute *mpt3sas_dev_attrs[]; +extern const struct attribute_group *mpt3sas_host_groups[]; +extern const struct attribute_group *mpt3sas_dev_groups[];void mpt3sas_ctl_init (ushort hbas_to_enumerate);void mpt3sas_ctl_exit (ushort hbas_to_enumerate); u8 mpt3sas_ctl_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
drivers/scsi/mpt3sas/mpt3sas_ctl.c +51 -33
102 lines not on this page · raw message
drivers/scsi/mpt3sas/mpt3sas_scsih.c +4 -4
@@ -11876,8 +11876,8 @@ static struct scsi_host_template mpt2sas_driver_template = { .sg_tablesize = MPT2SAS_SG_DEPTH, .max_sectors = 32767, .cmd_per_lun = 7, - .shost_attrs = mpt3sas_host_attrs, - .sdev_attrs = mpt3sas_dev_attrs, + .shost_groups = mpt3sas_host_groups, + .sdev_groups = mpt3sas_dev_groups, .track_queue_depth = 1, .cmd_size = sizeof(struct scsiio_tracker), };
@@ -11915,8 +11915,8 @@ static struct scsi_host_template mpt3sas_driver_template = { .max_sectors = 32767, .max_segment_size = 0xffffffff, .cmd_per_lun = 7, - .shost_attrs = mpt3sas_host_attrs, - .sdev_attrs = mpt3sas_dev_attrs, + .shost_groups = mpt3sas_host_groups, + .sdev_groups = mpt3sas_dev_groups, .track_queue_depth = 1, .cmd_size = sizeof(struct scsiio_tracker), .map_queues = scsih_map_queues,
Bart Van Assche
maintainerPATCH v4 30/46 scsi: mvsas: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/mvsas/mv_init.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/scsi/mvsas/mv_init.c +7 -5
@@ -25,7 +25,7 @@ static const struct mvs_chip_info mvs_chips[] = { [chip_1320] = { 2, 4, 0x800, 17, 64, 8, 9, &mvs_94xx_dispatch, }, }; -static struct device_attribute *mvst_host_attrs[]; +static const struct attribute_group *mvst_host_groups[];#define SOC_SAS_NUM 2
@@ -52,7 +52,7 @@ static struct scsi_host_template mvs_sht = {#ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = mvst_host_attrs, + .shost_groups = mvst_host_groups, .track_queue_depth = 1, };
@@ -773,12 +773,14 @@ static void __exit mvs_exit(void)sas_release_transport (mvs_stt); } -static struct device_attribute *mvst_host_attrs[] = { - &dev_attr_driver_version, - &dev_attr_interrupt_coalescing, +static struct attribute *mvst_host_attrs[] = { + &dev_attr_driver_version.attr, + &dev_attr_interrupt_coalescing.attr,NULL , }; +ATTRIBUTE_GROUPS (mvst_host); +module_init (mvs_init);module_exit (mvs_exit);
Bart Van Assche
maintainerPATCH v4 31/46 scsi: myrb: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/myrb.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-)
drivers/scsi/myrb.c +16 -12
@@ -2182,22 +2182,26 @@ static ssize_t flush_cache_store(struct device *dev, }static DEVICE_ATTR_WO (flush_cache); -static struct device_attribute *myrb_sdev_attrs[] = { - &dev_attr_rebuild, - &dev_attr_consistency_check, - &dev_attr_raid_state, - &dev_attr_raid_level, +static struct attribute *myrb_sdev_attrs[] = { + &dev_attr_rebuild.attr, + &dev_attr_consistency_check.attr, + &dev_attr_raid_state.attr, + &dev_attr_raid_level.attr,NULL , }; -static struct device_attribute *myrb_shost_attrs[] = { - &dev_attr_ctlr_num, - &dev_attr_model, - &dev_attr_firmware, - &dev_attr_flush_cache, +ATTRIBUTE_GROUPS (myrb_sdev); + +static struct attribute *myrb_shost_attrs[] = { + &dev_attr_ctlr_num.attr, + &dev_attr_model.attr, + &dev_attr_firmware.attr, + &dev_attr_flush_cache.attr,NULL , }; +ATTRIBUTE_GROUPS (myrb_shost); +static struct scsi_host_template myrb_template = { .module =THIS_MODULE , .name ="DAC960" ,
@@ -2209,8 +2213,8 @@ static struct scsi_host_template myrb_template = { .slave_destroy = myrb_slave_destroy, .bios_param = myrb_biosparam, .cmd_size = sizeof(struct myrb_cmdblk), - .shost_attrs = myrb_shost_attrs, - .sdev_attrs = myrb_sdev_attrs, + .shost_groups = myrb_shost_groups, + .sdev_groups = myrb_sdev_groups, .this_id = -1, };
Bart Van Assche
maintainerPATCH v4 32/46 scsi: myrs: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/myrs.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-)
drivers/scsi/myrs.c +22 -18
@@ -1286,14 +1286,16 @@ static ssize_t consistency_check_store(struct device *dev, }static DEVICE_ATTR_RW (consistency_check); -static struct device_attribute *myrs_sdev_attrs[] = { - &dev_attr_consistency_check, - &dev_attr_rebuild, - &dev_attr_raid_state, - &dev_attr_raid_level, +static struct attribute *myrs_sdev_attrs[] = { + &dev_attr_consistency_check.attr, + &dev_attr_rebuild.attr, + &dev_attr_raid_state.attr, + &dev_attr_raid_level.attr,NULL , }; +ATTRIBUTE_GROUPS (myrs_sdev); +static ssize_t serial_show (struct device *dev,struct device_attribute *attr,char *buf) {
@@ -1510,20 +1512,22 @@ static ssize_t disable_enclosure_messages_store(struct device *dev, }static DEVICE_ATTR_RW (disable_enclosure_messages); -static struct device_attribute *myrs_shost_attrs[] = { - &dev_attr_serial, - &dev_attr_ctlr_num, - &dev_attr_processor, - &dev_attr_model, - &dev_attr_ctlr_type, - &dev_attr_cache_size, - &dev_attr_firmware, - &dev_attr_discovery, - &dev_attr_flush_cache, - &dev_attr_disable_enclosure_messages, +static struct attribute *myrs_shost_attrs[] = { + &dev_attr_serial.attr, + &dev_attr_ctlr_num.attr, + &dev_attr_processor.attr, + &dev_attr_model.attr, + &dev_attr_ctlr_type.attr, + &dev_attr_cache_size.attr, + &dev_attr_firmware.attr, + &dev_attr_discovery.attr, + &dev_attr_flush_cache.attr, + &dev_attr_disable_enclosure_messages.attr,NULL , }; +ATTRIBUTE_GROUPS (myrs_shost); +/* * SCSI midlayer interface */
@@ -1923,8 +1927,8 @@ static struct scsi_host_template myrs_template = { .slave_configure = myrs_slave_configure, .slave_destroy = myrs_slave_destroy, .cmd_size = sizeof(struct myrs_cmdblk), - .shost_attrs = myrs_shost_attrs, - .sdev_attrs = myrs_sdev_attrs, + .shost_groups = myrs_shost_groups, + .sdev_groups = myrs_sdev_groups, .this_id = -1, };
Bart Van Assche
maintainerPATCH v4 33/46 scsi: ncr53c8xx: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/ncr53c8xx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/scsi/ncr53c8xx.c +6 -4
@@ -8039,11 +8039,13 @@ static struct device_attribute ncr53c8xx_revision_attr = { .show = show_ncr53c8xx_revision, }; -static struct device_attribute *ncr53c8xx_host_attrs[] = { - &ncr53c8xx_revision_attr, +static struct attribute *ncr53c8xx_host_attrs[] = { + &ncr53c8xx_revision_attr.attr,NULL }; +ATTRIBUTE_GROUPS (ncr53c8xx_host); +/*========================================================== ** ** Boot command line.
@@ -8085,8 +8087,8 @@ struct Scsi_Host * __init ncr_attach(struct scsi_host_template *tpnt,if (!tpnt->name) tpnt->name =SCSI_NCR_DRIVER_NAME ; -if (!tpnt->shost_attrs) - tpnt->shost_attrs = ncr53c8xx_host_attrs; +if (!tpnt->shost_groups) + tpnt->shost_groups = ncr53c8xx_host_groups; tpnt->queuecommand = ncr53c8xx_queue_command; tpnt->slave_configure = ncr53c8xx_slave_configure;
Bart Van Assche
maintainerPATCH v4 34/46 scsi: sym53c500_cs: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/pcmcia/sym53c500_cs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/pcmcia/sym53c500_cs.c +5 -3
@@ -652,11 +652,13 @@ static struct device_attribute SYM53C500_pio_attr = { .store = SYM53C500_store_pio, }; -static struct device_attribute *SYM53C500_shost_attrs[] = { - &SYM53C500_pio_attr, +static struct attribute *SYM53C500_shost_attrs[] = { + &SYM53C500_pio_attr.attr,NULL , }; +ATTRIBUTE_GROUPS (SYM53C500_shost); +/* * scsi_host_template initializer */
@@ -671,7 +673,7 @@ static struct scsi_host_template sym53c500_driver_template = { .can_queue = 1, .this_id = 7, .sg_tablesize = 32, - .shost_attrs = SYM53C500_shost_attrs + .shost_groups = SYM53C500_shost_groups };static int SYM53C500_config_check (struct pcmcia_device *p_dev,void *priv_data)
Bart Van Assche
maintainerPATCH v4 35/46 scsi: pm8001: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/pm8001/pm8001_ctl.c | 64 +++++++++++++++++-------------- drivers/scsi/pm8001/pm8001_init.c | 2 +- drivers/scsi/pm8001/pm8001_sas.h | 2 +- 3 files changed, 38 insertions(+), 30 deletions(-)
drivers/scsi/pm8001/pm8001_ctl.c +36 -28
@@ -1002,34 +1002,42 @@ static ssize_t ctl_iop1_count_show(struct device *cdev, }static DEVICE_ATTR_RO (ctl_iop1_count); -struct device_attribute *pm8001_host_attrs[] = { - &dev_attr_interface_rev, - &dev_attr_controller_fatal_error, - &dev_attr_fw_version, - &dev_attr_update_fw, - &dev_attr_aap_log, - &dev_attr_iop_log, - &dev_attr_fatal_log, - &dev_attr_non_fatal_log, - &dev_attr_non_fatal_count, - &dev_attr_gsm_log, - &dev_attr_max_out_io, - &dev_attr_max_devices, - &dev_attr_max_sg_list, - &dev_attr_sas_spec_support, - &dev_attr_logging_level, - &dev_attr_event_log_size, - &dev_attr_host_sas_address, - &dev_attr_bios_version, - &dev_attr_ib_log, - &dev_attr_ob_log, - &dev_attr_ila_version, - &dev_attr_inc_fw_ver, - &dev_attr_ctl_mpi_state, - &dev_attr_ctl_hmi_error, - &dev_attr_ctl_raae_count, - &dev_attr_ctl_iop0_count, - &dev_attr_ctl_iop1_count, +static struct attribute *pm8001_host_attrs[] = { + &dev_attr_interface_rev.attr, + &dev_attr_controller_fatal_error.attr, + &dev_attr_fw_version.attr, + &dev_attr_update_fw.attr, + &dev_attr_aap_log.attr, + &dev_attr_iop_log.attr, + &dev_attr_fatal_log.attr, + &dev_attr_non_fatal_log.attr, + &dev_attr_non_fatal_count.attr, + &dev_attr_gsm_log.attr, + &dev_attr_max_out_io.attr, + &dev_attr_max_devices.attr, + &dev_attr_max_sg_list.attr, + &dev_attr_sas_spec_support.attr, + &dev_attr_logging_level.attr, + &dev_attr_event_log_size.attr, + &dev_attr_host_sas_address.attr, + &dev_attr_bios_version.attr, + &dev_attr_ib_log.attr, + &dev_attr_ob_log.attr, + &dev_attr_ila_version.attr, + &dev_attr_inc_fw_ver.attr, + &dev_attr_ctl_mpi_state.attr, + &dev_attr_ctl_hmi_error.attr, + &dev_attr_ctl_raae_count.attr, + &dev_attr_ctl_iop0_count.attr, + &dev_attr_ctl_iop1_count.attr,NULL , }; +static const struct attribute_group pm8001_host_attr_group = { + .attrs = pm8001_host_attrs +}; + +const struct attribute_group *pm8001_host_groups[] = { + &pm8001_host_attr_group, +NULL +};
drivers/scsi/pm8001/pm8001_init.c +1 -1
@@ -107,7 +107,7 @@ static struct scsi_host_template pm8001_sht = {#ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = pm8001_host_attrs, + .shost_groups = pm8001_host_groups, .track_queue_depth = 1, };
drivers/scsi/pm8001/pm8001_sas.h +1 -1
@@ -733,7 +733,7 @@ ssize_t pm8001_get_gsm_dump(struct device *cdev, u32, char *buf);int pm80xx_fatal_errors (struct pm8001_hba_info *pm8001_ha);void pm8001_free_dev (struct pm8001_device *pm8001_dev);/* ctl shared API */ -extern struct device_attribute *pm8001_host_attrs[]; +extern const struct attribute_group *pm8001_host_groups[]; static inline void pm8001_ccb_task_free_done(struct pm8001_hba_info *pm8001_ha,
Bart Van Assche
maintainerPATCH v4 36/46 scsi: pmcraid: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/pmcraid.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/scsi/pmcraid.c +6 -5
@@ -4097,13 +4097,14 @@ static struct device_attribute pmcraid_adapter_id_attr = { .show = pmcraid_show_adapter_id, }; -static struct device_attribute *pmcraid_host_attrs[] = { - &pmcraid_log_level_attr, - &pmcraid_driver_version_attr, - &pmcraid_adapter_id_attr, +static struct attribute *pmcraid_host_attrs[] = { + &pmcraid_log_level_attr.attr, + &pmcraid_driver_version_attr.attr, + &pmcraid_adapter_id_attr.attr,NULL , }; +ATTRIBUTE_GROUPS (pmcraid_host);/* host template structure for pmcraid driver */ static struct scsi_host_template pmcraid_host_template = {
@@ -4126,7 +4127,7 @@ static struct scsi_host_template pmcraid_host_template = { .max_sectors = PMCRAID_IOA_MAX_SECTORS, .no_write_same = 1, .cmd_per_lun = PMCRAID_MAX_CMD_PER_LUN, - .shost_attrs = pmcraid_host_attrs, + .shost_groups = pmcraid_host_groups, .proc_name = PMCRAID_DRIVER_NAME, };
Bart Van Assche
maintainerPATCH v4 37/46 scsi: qedf: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/qedf/qedf.h | 2 +- drivers/scsi/qedf/qedf_attr.c | 15 ++++++++++++--- drivers/scsi/qedf/qedf_main.c | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-)
drivers/scsi/qedf/qedf.h +1 -1
@@ -498,7 +498,7 @@ extern void qedf_process_abts_compl(struct qedf_ctx *qedf, struct fcoe_cqe *cqe,extern struct qedf_ioreq *qedf_alloc_cmd (struct qedf_rport *fcport,u8 cmd_type); -extern struct device_attribute *qedf_host_attrs[]; +extern const struct attribute_group *qedf_host_groups[];extern void qedf_cmd_timer_set (struct qedf_ctx *qedf,struct qedf_ioreq *io_req,unsigned int timer_msec);extern int qedf_init_mp_req (struct qedf_ioreq *io_req);
drivers/scsi/qedf/qedf_attr.c +12 -3
@@ -60,12 +60,21 @@ static ssize_t fka_period_show(struct device *dev,static DEVICE_ATTR_RO (fcoe_mac);static DEVICE_ATTR_RO (fka_period); -struct device_attribute *qedf_host_attrs[] = { - &dev_attr_fcoe_mac, - &dev_attr_fka_period, +static struct attribute *qedf_host_attrs[] = { + &dev_attr_fcoe_mac.attr, + &dev_attr_fka_period.attr,NULL , }; +static const struct attribute_group qedf_host_attr_group = { + .attrs = qedf_host_attrs +}; + +const struct attribute_group *qedf_host_groups[] = { + &qedf_host_attr_group, +NULL +}; +extern const struct qed_fcoe_ops *qed_ops;void qedf_capture_grc_dump (struct qedf_ctx *qedf)
drivers/scsi/qedf/qedf_main.c +1 -1
@@ -986,7 +986,7 @@ static struct scsi_host_template qedf_host_template = { .cmd_per_lun = 32, .max_sectors = 0xffff, .queuecommand = qedf_queuecommand, - .shost_attrs = qedf_host_attrs, + .shost_groups = qedf_host_groups, .eh_abort_handler = qedf_eh_abort, .eh_device_reset_handler = qedf_eh_device_reset, /* lun reset */ .eh_target_reset_handler = qedf_eh_target_reset, /* target reset */
Bart Van Assche
maintainerPATCH v4 38/46 scsi: qedi: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/qedi/qedi_gbl.h | 2 +- drivers/scsi/qedi/qedi_iscsi.c | 2 +- drivers/scsi/qedi/qedi_sysfs.c | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-)
drivers/scsi/qedi/qedi_gbl.h +1 -1
@@ -22,7 +22,7 @@ extern struct iscsi_transport qedi_iscsi_transport;extern const struct qed_iscsi_ops *qedi_ops;extern const struct qedi_debugfs_ops qedi_debugfs_ops[];extern const struct file_operations qedi_dbg_fops[]; -extern struct device_attribute *qedi_shost_attrs[]; +extern const struct attribute_group *qedi_shost_groups[];int qedi_alloc_sq (struct qedi_ctx *qedi,struct qedi_endpoint *ep);void qedi_free_sq (struct qedi_ctx *qedi,struct qedi_endpoint *ep);
drivers/scsi/qedi/qedi_iscsi.c +1 -1
@@ -58,7 +58,7 @@ struct scsi_host_template qedi_host_template = { .max_sectors = 0xffff, .dma_boundary = QEDI_HW_DMA_BOUNDARY, .cmd_per_lun = 128, - .shost_attrs = qedi_shost_attrs, + .shost_groups = qedi_shost_groups, }; static void qedi_conn_free_login_resources(struct qedi_ctx *qedi,
drivers/scsi/qedi/qedi_sysfs.c +12 -3
@@ -42,8 +42,17 @@ static ssize_t speed_show(struct device *dev,static DEVICE_ATTR_RO (port_state);static DEVICE_ATTR_RO (speed); -struct device_attribute *qedi_shost_attrs[] = { - &dev_attr_port_state, - &dev_attr_speed, +static struct attribute *qedi_shost_attrs[] = { + &dev_attr_port_state.attr, + &dev_attr_speed.attr, +NULL +}; + +static const struct attribute_group qedi_shost_attr_group = { + .attrs = qedi_shost_attrs +}; + +const struct attribute_group *qedi_shost_groups[] = { + &qedi_shost_attr_group,NULL };
Bart Van Assche
maintainerPATCH v4 39/46 scsi: qla2xxx: Remove a declaration
In reply to Bart Van AsscheSince there is no definition for the qla2x00_host_attrs_dm array, remove its declaration.
--- drivers/scsi/qla2xxx/qla_gbl.h | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/qla2xxx/qla_gbl.h +0 -1
@@ -743,7 +743,6 @@ uint qla25xx_fdmi_port_speed_currently(struct qla_hw_data *);*/ struct device_attribute ;extern struct device_attribute *qla2x00_host_attrs[]; -extern struct device_attribute *qla2x00_host_attrs_dm[];struct fc_function_template ;extern struct fc_function_template qla2xxx_transport_functions;extern struct fc_function_template qla2xxx_transport_vport_functions;
Bart Van Assche
maintainerPATCH v4 40/46 scsi: qla2xxx: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Additionally, remove qla_insert_tgt_attrs() and replace it with qla_host_attr_is_visible().
--- drivers/scsi/qla2xxx/qla_attr.c | 125 +++++++++++++++++--------------- drivers/scsi/qla2xxx/qla_gbl.h | 3 +- drivers/scsi/qla2xxx/qla_os.c | 5 +- 3 files changed, 67 insertions(+), 66 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +65 -60
@@ -2481,72 +2481,77 @@ static DEVICE_ATTR(port_no, 0444, qla2x00_port_no_show, NULL); static DEVICE_ATTR(fw_attr, 0444, qla2x00_fw_attr_show, NULL);static DEVICE_ATTR_RO (edif_doorbell); - -struct device_attribute *qla2x00_host_attrs[] = { - &dev_attr_driver_version, - &dev_attr_fw_version, - &dev_attr_serial_num, - &dev_attr_isp_name, - &dev_attr_isp_id, - &dev_attr_model_name, - &dev_attr_model_desc, - &dev_attr_pci_info, - &dev_attr_link_state, - &dev_attr_zio, - &dev_attr_zio_timer, - &dev_attr_beacon, - &dev_attr_beacon_config, - &dev_attr_optrom_bios_version, - &dev_attr_optrom_efi_version, - &dev_attr_optrom_fcode_version, - &dev_attr_optrom_fw_version, - &dev_attr_84xx_fw_version, - &dev_attr_total_isp_aborts, - &dev_attr_serdes_version, - &dev_attr_mpi_version, - &dev_attr_phy_version, - &dev_attr_flash_block_size, - &dev_attr_vlan_id, - &dev_attr_vn_port_mac_address, - &dev_attr_fabric_param, - &dev_attr_fw_state, - &dev_attr_optrom_gold_fw_version, - &dev_attr_thermal_temp, - &dev_attr_diag_requests, - &dev_attr_diag_megabytes, - &dev_attr_fw_dump_size, - &dev_attr_allow_cna_fw_dump, - &dev_attr_pep_version, - &dev_attr_min_supported_speed, - &dev_attr_max_supported_speed, - &dev_attr_zio_threshold, - &dev_attr_dif_bundle_statistics, - &dev_attr_port_speed, - &dev_attr_port_no, - &dev_attr_fw_attr, - &dev_attr_dport_diagnostics, - &dev_attr_edif_doorbell, - &dev_attr_mpi_pause, -NULL ,/* reserve for qlini_mode */ -NULL ,/* reserve for ql2xiniexchg */ -NULL ,/* reserve for ql2xexchoffld */ +static struct attribute *qla2x00_host_attrs[] = { + &dev_attr_driver_version.attr, + &dev_attr_fw_version.attr, + &dev_attr_serial_num.attr, + &dev_attr_isp_name.attr, + &dev_attr_isp_id.attr, + &dev_attr_model_name.attr, + &dev_attr_model_desc.attr, + &dev_attr_pci_info.attr, + &dev_attr_link_state.attr, + &dev_attr_zio.attr, + &dev_attr_zio_timer.attr, + &dev_attr_beacon.attr, + &dev_attr_beacon_config.attr, + &dev_attr_optrom_bios_version.attr, + &dev_attr_optrom_efi_version.attr, + &dev_attr_optrom_fcode_version.attr, + &dev_attr_optrom_fw_version.attr, + &dev_attr_84xx_fw_version.attr, + &dev_attr_total_isp_aborts.attr, + &dev_attr_serdes_version.attr, + &dev_attr_mpi_version.attr, + &dev_attr_phy_version.attr, + &dev_attr_flash_block_size.attr, + &dev_attr_vlan_id.attr, + &dev_attr_vn_port_mac_address.attr, + &dev_attr_fabric_param.attr, + &dev_attr_fw_state.attr, + &dev_attr_optrom_gold_fw_version.attr, + &dev_attr_thermal_temp.attr, + &dev_attr_diag_requests.attr, + &dev_attr_diag_megabytes.attr, + &dev_attr_fw_dump_size.attr, + &dev_attr_allow_cna_fw_dump.attr, + &dev_attr_pep_version.attr, + &dev_attr_min_supported_speed.attr, + &dev_attr_max_supported_speed.attr, + &dev_attr_zio_threshold.attr, + &dev_attr_dif_bundle_statistics.attr, + &dev_attr_port_speed.attr, + &dev_attr_port_no.attr, + &dev_attr_fw_attr.attr, + &dev_attr_dport_diagnostics.attr, + &dev_attr_edif_doorbell.attr, + &dev_attr_mpi_pause.attr, + &dev_attr_qlini_mode.attr, + &dev_attr_ql2xiniexchg.attr, + &dev_attr_ql2xexchoffld.attr,NULL , }; -void qla_insert_tgt_attrs (void ) +static umode_t qla_host_attr_is_visible (struct kobject *kobj, +struct attribute *attr,int i) { -struct device_attribute **attr; +if (ql2x_ini_mode !=QLA2XXX_INI_MODE_DUAL && + (attr == &dev_attr_qlini_mode.attr || + attr == &dev_attr_ql2xiniexchg.attr || + attr == &dev_attr_ql2xexchoffld.attr)) +return 0 ; +return attr->mode; +} -/* advance to empty slot */ -for (attr = &qla2x00_host_attrs[0 ]; *attr; ++attr) -continue ; +static const struct attribute_group qla2x00_host_attr_group = { + .is_visible = qla_host_attr_is_visible, + .attrs = qla2x00_host_attrs +}; - *attr = &dev_attr_qlini_mode; - attr++; - *attr = &dev_attr_ql2xiniexchg; - attr++; - *attr = &dev_attr_ql2xexchoffld; -} +const struct attribute_group *qla2x00_host_groups[] = { + &qla2x00_host_attr_group, +NULL +};/* Host attributes. */
drivers/scsi/qla2xxx/qla_gbl.h +1 -2
@@ -742,7 +742,7 @@ uint qla25xx_fdmi_port_speed_currently(struct qla_hw_data *);* Global Function Prototypes in qla_attr.c source file. */ struct device_attribute ; -extern struct device_attribute *qla2x00_host_attrs[]; +extern const struct attribute_group *qla2x00_host_groups[];struct fc_function_template ;extern struct fc_function_template qla2xxx_transport_functions;extern struct fc_function_template qla2xxx_transport_vport_functions;
@@ -756,7 +756,6 @@ extern int qla2x00_echo_test(scsi_qla_host_t *,extern int qla24xx_update_all_fcp_prio (scsi_qla_host_t *);extern int qla24xx_fcp_prio_cfg_valid (scsi_qla_host_t *,struct qla_fcp_prio_cfg *,uint8_t ); -void qla_insert_tgt_attrs (void );/* * Global Function Prototypes in qla_dfs.c source file. */
drivers/scsi/qla2xxx/qla_os.c +1 -4
@@ -7943,7 +7943,7 @@ struct scsi_host_template qla2xxx_driver_template = { .sg_tablesize = SG_ALL, .max_sectors = 0xFFFF, - .shost_attrs = qla2x00_host_attrs, + .shost_groups = qla2x00_host_groups, .supported_mode = MODE_INITIATOR, .track_queue_depth = 1,
@@ -8131,9 +8131,6 @@ qla2x00_module_init(void)if (ql2xextended_error_logging ==1 ) ql2xextended_error_logging =QL_DBG_DEFAULT1_MASK ; -if (ql2x_ini_mode ==QLA2XXX_INI_MODE_DUAL ) -qla_insert_tgt_attrs (); - qla2xxx_transport_template =fc_attach_transport (&qla2xxx_transport_functions);if (!qla2xxx_transport_template) {
Bart Van Assche
maintainerPATCH v4 41/46 scsi: qla4xxx: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/qla4xxx/ql4_attr.c | 41 ++++++++++++++++++++------------- drivers/scsi/qla4xxx/ql4_glbl.h | 3 ++- drivers/scsi/qla4xxx/ql4_os.c | 2 +- 3 files changed, 28 insertions(+), 18 deletions(-)
drivers/scsi/qla4xxx/ql4_attr.c +25 -16
@@ -330,21 +330,30 @@ static DEVICE_ATTR(fw_ext_timestamp, S_IRUGO, qla4xxx_fw_ext_timestamp_show, static DEVICE_ATTR(fw_load_src, S_IRUGO, qla4xxx_fw_load_src_show, NULL); static DEVICE_ATTR(fw_uptime, S_IRUGO, qla4xxx_fw_uptime_show, NULL); -struct device_attribute *qla4xxx_host_attrs[] = { - &dev_attr_fw_version, - &dev_attr_serial_num, - &dev_attr_iscsi_version, - &dev_attr_optrom_version, - &dev_attr_board_id, - &dev_attr_fw_state, - &dev_attr_phy_port_cnt, - &dev_attr_phy_port_num, - &dev_attr_iscsi_func_cnt, - &dev_attr_hba_model, - &dev_attr_fw_timestamp, - &dev_attr_fw_build_user, - &dev_attr_fw_ext_timestamp, - &dev_attr_fw_load_src, - &dev_attr_fw_uptime, +static struct attribute *qla4xxx_host_attrs[] = { + &dev_attr_fw_version.attr, + &dev_attr_serial_num.attr, + &dev_attr_iscsi_version.attr, + &dev_attr_optrom_version.attr, + &dev_attr_board_id.attr, + &dev_attr_fw_state.attr, + &dev_attr_phy_port_cnt.attr, + &dev_attr_phy_port_num.attr, + &dev_attr_iscsi_func_cnt.attr, + &dev_attr_hba_model.attr, + &dev_attr_fw_timestamp.attr, + &dev_attr_fw_build_user.attr, + &dev_attr_fw_ext_timestamp.attr, + &dev_attr_fw_load_src.attr, + &dev_attr_fw_uptime.attr,NULL , }; + +static const struct attribute_group qla4xxx_host_attr_group = { + .attrs = qla4xxx_host_attrs +}; + +const struct attribute_group *qla4xxx_host_groups[] = { + &qla4xxx_host_attr_group, +NULL +};
drivers/scsi/qla4xxx/ql4_glbl.h +2 -1
@@ -286,5 +286,6 @@ extern int ql4xenablemsix;extern int ql4xmdcapmask;extern int ql4xenablemd; -extern struct device_attribute *qla4xxx_host_attrs[]; +extern const struct attribute_group *qla4xxx_host_groups[]; +#endif /* _QLA4x_GBL_H */
drivers/scsi/qla4xxx/ql4_os.c +1 -1
@@ -241,7 +241,7 @@ static struct scsi_host_template qla4xxx_driver_template = { .sg_tablesize = SG_ALL, .max_sectors = 0xFFFF, - .shost_attrs = qla4xxx_host_attrs, + .shost_groups = qla4xxx_host_groups, .host_reset = qla4xxx_host_reset, .vendor_id = SCSI_NL_VID_TYPE_PCI | PCI_VENDOR_ID_QLOGIC, };
Bart Van Assche
maintainerPATCH v4 42/46 scsi: smartpqi: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/smartpqi/smartpqi_init.c | 46 +++++++++++++++------------ 1 file changed, 25 insertions(+), 21 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +25 -21
@@ -6847,20 +6847,22 @@ static DEVICE_ATTR(enable_r5_writes, 0644, static DEVICE_ATTR(enable_r6_writes, 0644, pqi_host_enable_r6_writes_show, pqi_host_enable_r6_writes_store); -static struct device_attribute *pqi_shost_attrs[] = { - &dev_attr_driver_version, - &dev_attr_firmware_version, - &dev_attr_model, - &dev_attr_serial_number, - &dev_attr_vendor, - &dev_attr_rescan, - &dev_attr_lockup_action, - &dev_attr_enable_stream_detection, - &dev_attr_enable_r5_writes, - &dev_attr_enable_r6_writes, +static struct attribute *pqi_shost_attrs[] = { + &dev_attr_driver_version.attr, + &dev_attr_firmware_version.attr, + &dev_attr_model.attr, + &dev_attr_serial_number.attr, + &dev_attr_vendor.attr, + &dev_attr_rescan.attr, + &dev_attr_lockup_action.attr, + &dev_attr_enable_stream_detection.attr, + &dev_attr_enable_r5_writes.attr, + &dev_attr_enable_r6_writes.attr,NULL }; +ATTRIBUTE_GROUPS (pqi_shost); +static ssize_t pqi_unique_id_show (struct device *dev,struct device_attribute *attr,char *buffer) {
@@ -7129,17 +7131,19 @@ static DEVICE_ATTR(ssd_smart_path_enabled, 0444, pqi_ssd_smart_path_enabled_show static DEVICE_ATTR(raid_level, 0444, pqi_raid_level_show, NULL); static DEVICE_ATTR(raid_bypass_cnt, 0444, pqi_raid_bypass_cnt_show, NULL); -static struct device_attribute *pqi_sdev_attrs[] = { - &dev_attr_lunid, - &dev_attr_unique_id, - &dev_attr_path_info, - &dev_attr_sas_address, - &dev_attr_ssd_smart_path_enabled, - &dev_attr_raid_level, - &dev_attr_raid_bypass_cnt, +static struct attribute *pqi_sdev_attrs[] = { + &dev_attr_lunid.attr, + &dev_attr_unique_id.attr, + &dev_attr_path_info.attr, + &dev_attr_sas_address.attr, + &dev_attr_ssd_smart_path_enabled.attr, + &dev_attr_raid_level.attr, + &dev_attr_raid_bypass_cnt.attr,NULL }; +ATTRIBUTE_GROUPS (pqi_sdev); +static struct scsi_host_template pqi_driver_template = { .module =THIS_MODULE , .name =DRIVER_NAME_SHORT ,
@@ -7153,8 +7157,8 @@ static struct scsi_host_template pqi_driver_template = { .slave_alloc = pqi_slave_alloc, .slave_configure = pqi_slave_configure, .map_queues = pqi_map_queues, - .sdev_attrs = pqi_sdev_attrs, - .shost_attrs = pqi_shost_attrs, + .sdev_groups = pqi_sdev_groups, + .shost_groups = pqi_shost_groups, };static int pqi_register_scsi (struct pqi_ctrl_info *ctrl_info)
Bart Van Assche
maintainerPATCH v4 43/46 scsi: snic: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/scsi/snic/snic.h | 2 +- drivers/scsi/snic/snic_attrs.c | 19 ++++++++++++++----- drivers/scsi/snic/snic_main.c | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-)
drivers/scsi/snic/snic.h +1 -1
@@ -374,7 +374,7 @@ int snic_glob_init(void);void snic_glob_cleanup (void );extern struct workqueue_struct *snic_event_queue; -extern struct device_attribute *snic_attrs[]; +extern const struct attribute_group *snic_host_groups[];int snic_queuecommand (struct Scsi_Host *,struct scsi_cmnd *);int snic_abort_cmd (struct scsi_cmnd *);
drivers/scsi/snic/snic_attrs.c +14 -5
@@ -68,10 +68,19 @@ static DEVICE_ATTR(snic_state, S_IRUGO, snic_show_state, NULL); static DEVICE_ATTR(drv_version, S_IRUGO, snic_show_drv_version, NULL); static DEVICE_ATTR(link_state, S_IRUGO, snic_show_link_state, NULL); -struct device_attribute *snic_attrs[] = { - &dev_attr_snic_sym_name, - &dev_attr_snic_state, - &dev_attr_drv_version, - &dev_attr_link_state, +static struct attribute *snic_host_attrs[] = { + &dev_attr_snic_sym_name.attr, + &dev_attr_snic_state.attr, + &dev_attr_drv_version.attr, + &dev_attr_link_state.attr,NULL , }; + +static const struct attribute_group snic_host_attr_group = { + .attrs = snic_host_attrs +}; + +const struct attribute_group *snic_host_groups[] = { + &snic_host_attr_group, +NULL +};
drivers/scsi/snic/snic_main.c +1 -1
@@ -129,7 +129,7 @@ static struct scsi_host_template snic_host_template = { .can_queue = SNIC_MAX_IO_REQ, .sg_tablesize = SNIC_MAX_SG_DESC_CNT, .max_sectors = 0x800, - .shost_attrs = snic_attrs, + .shost_groups = snic_host_groups, .track_queue_depth = 1, .cmd_size = sizeof(struct snic_internal_io_state), .proc_name = "snic_scsi",
Bart Van Assche
maintainerPATCH v4 44/46 scsi: unisys: Remove the shost_attrs member
In reply to Bart Van AsscheThis patch prepares for removal of the shost_attrs member from struct scsi_host_template.
--- drivers/staging/unisys/visorhba/visorhba_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/unisys/visorhba/visorhba_main.c +0 -1
@@ -584,7 +584,6 @@ static struct scsi_host_template visorhba_driver_template = { .eh_device_reset_handler = visorhba_device_reset_handler, .eh_bus_reset_handler = visorhba_bus_reset_handler, .eh_host_reset_handler = visorhba_host_reset_handler, - .shost_attrs = NULL,#define visorhba_MAX_CMNDS 128 .can_queue = visorhba_MAX_CMNDS, .sg_tablesize = 64,
Bart Van Assche
maintainerPATCH v4 45/46 scsi: usb: Switch to attribute groups
In reply to Bart Van Asschestruct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups.
--- drivers/usb/storage/scsiglue.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/usb/storage/scsiglue.c +5 -3
@@ -588,11 +588,13 @@ static ssize_t max_sectors_store(struct device *dev, struct device_attribute *at }static DEVICE_ATTR_RW (max_sectors); -static struct device_attribute *sysfs_device_attr_list[] = { - &dev_attr_max_sectors, +static struct attribute *usb_sdev_attrs[] = { + &dev_attr_max_sectors.attr,NULL , }; +ATTRIBUTE_GROUPS (usb_sdev); +/* * this defines our host template, with which we'll allocate hosts */
@@ -653,7 +655,7 @@ static const struct scsi_host_template usb_stor_host_template = { .skip_settle_delay = 1,/* sysfs device attributes */ - .sdev_attrs = sysfs_device_attr_list, + .sdev_groups = usb_sdev_groups,/* module management */ .module = THIS_MODULE
Bart Van Assche
maintainerPATCH v4 46/46 scsi: core: Remove two host template members that are no longer used
In reply to Bart Van AsscheAll SCSI drivers have been converted to use shost_groups and sdev_groups instead of shost_attrs or sdev_attrs. Hence remove shost_attrs and sdev_attrs. Additionally, remove the 'lld_attr_group' members and also the scsi_convert_dev_attrs() function.
--- drivers/scsi/hosts.c | 9 --------- drivers/scsi/scsi_priv.h | 2 -- drivers/scsi/scsi_sysfs.c | 28 ---------------------------- include/scsi/scsi_device.h | 1 - include/scsi/scsi_host.h | 11 ----------- 5 files changed, 51 deletions(-)
drivers/scsi/hosts.c +0 -9
@@ -482,15 +482,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)dev_set_name (&shost->shost_dev,"host%d" , shost->host_no); shost->shost_dev.groups = shost->shost_dev_attr_groups; shost->shost_dev_attr_groups[j++] = &scsi_shost_attr_group; -if (sht->shost_attrs) { - shost->lld_attr_group = (struct attribute_group ){ - .attrs =scsi_convert_dev_attrs (&shost->shost_gendev, - sht->shost_attrs) - }; -if (shost->lld_attr_group.attrs) - shost->shost_dev_attr_groups[j++] = - &shost->lld_attr_group; - }if (sht->shost_groups) { for (i = 0; sht->shost_groups[i] && j < ARRAY_SIZE(shost->shost_dev_attr_groups);
drivers/scsi/scsi_priv.h +0 -2
@@ -137,8 +137,6 @@ extern int scsi_sysfs_add_sdev(struct scsi_device *);extern int scsi_sysfs_add_host (struct Scsi_Host *);extern int scsi_sysfs_register (void );extern void scsi_sysfs_unregister (void ); -struct attribute **scsi_convert_dev_attrs (struct device *dev, -struct device_attribute **dev_attr);extern void scsi_sysfs_device_initialize (struct scsi_device *);extern int scsi_sysfs_target_initialize (struct scsi_device *);extern struct scsi_transport_template blank_transport_template;
drivers/scsi/scsi_sysfs.c +0 -28
@@ -1563,26 +1563,6 @@ int scsi_sysfs_add_host(struct Scsi_Host *shost)return 0 ; } -/* -* Convert an array of struct device_attribute pointers into an array of -* struct attribute pointers. -*/ -struct attribute **scsi_convert_dev_attrs (struct device *dev, -struct device_attribute **dev_attr) -{ -struct attribute **attrs; -int i; - -for (i =0 ; dev_attr[i]; i++) - ; - attrs =devm_kzalloc (dev, (i +1 ) *sizeof (*attrs),GFP_KERNEL ); -if (!attrs) -return NULL ; -for (i =0 ; dev_attr[i]; i++) - attrs[i] = &dev_attr[i]->attr; -return attrs; -} -static struct device_type scsi_dev_type = { .name ="scsi_device" , .release = scsi_device_dev_release,
@@ -1603,14 +1583,6 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev)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; -if (hostt->sdev_attrs) { - sdev->lld_attr_group = (struct attribute_group ){ - .attrs =scsi_convert_dev_attrs (&sdev->sdev_gendev, - hostt->sdev_attrs) - }; -if (sdev->lld_attr_group.attrs) - sdev->gendev_attr_groups[j++] = &sdev->lld_attr_group; - }if (hostt->sdev_groups) { for (i = 0; hostt->sdev_groups[i] && j < ARRAY_SIZE(sdev->gendev_attr_groups);
include/scsi/scsi_device.h +0 -1
@@ -225,7 +225,6 @@ struct scsi_device {struct device sdev_gendev, sdev_dev; -struct attribute_group lld_attr_group;/* * The array size 6 provides space for one attribute group for the * SCSI core, four attribute groups defined by SCSI LLDs and one
include/scsi/scsi_host.h +0 -11
@@ -473,16 +473,6 @@ struct scsi_host_template {*/ #define SCSI_DEFAULT_HOST_BLOCKED 7 -/* -* Pointer to the sysfs class properties for this host, NULL terminated. -*/ -struct device_attribute **shost_attrs; - -/* -* Pointer to the SCSI device properties for this host, NULL terminated. -*/ -struct device_attribute **sdev_attrs; -/* * Pointer to the SCSI host sysfs attribute groups, NULL terminated. */
@@ -700,7 +690,6 @@ struct Scsi_Host {/* ldm bits */ struct device shost_gendev, shost_dev; -struct attribute_group lld_attr_group;/* * The array size 3 provides space for one attribute group defined by * the SCSI core, one attribute group defined by the SCSI LLD and one
Martin K. Petersen
AppliedBart,
Quoted 5 lines
For certain user space software, e.g. udev, it is important that sysfs attributes are registered before the
KOBJ_ADDuevent is emitted. Hence this patch series that removes thedevice_create_file()andsysfs_create_groups()calls from the SCSI core. Please consider this patch series for kernel v5.16.
Applied to 5.16/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 9 lines · Bart Van Assche
For certain user space software, e.g. udev, it is important that sysfs attributes are registered before the
KOBJ_ADDuevent is emitted. Hence this patch series that removes thedevice_create_file()andsysfs_create_groups()calls from the SCSI core. Please consider this patch series for kernel v5.16.Thanks,
[...]
Applied to 5.16/scsi-queue, thanks!
[01/46] scsi: core: Register sysfs attributes earlier
https://git.kernel.org/mkp/scsi/c/92c4b58b15c5 [02/46] ata: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/c3f69c7f629f [03/46] firewire: sbp2: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/5e88e67b6f3b [04/46] RDMA/srp: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/a3cf94c96ede [05/46] scsi: message: fusion: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/2899836f9430 [06/46] scsi: zfcp: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/d8d7cf3f7d07 [07/46] scsi: 3w-9xxx: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/bd21c1e9891f [08/46] scsi: 3w-sas: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/8de1cc904e17 [09/46] scsi: 3w-xxxx: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/65bc2a7fd83e [10/46] scsi: 53c700: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/90cb6538b5da [11/46] scsi: aacraid: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/bd16d71185c8 [12/46] scsi: arcmsr: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/f2523502a40a [13/46] scsi: be2iscsi: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/ebcbac342cb5 [14/46] scsi: bfa: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/e73af234a1a2 [15/46] scsi: bnx2fc: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/c3dd11d8ed4d [16/46] scsi: bnx2i: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/eb78ac7a5474 [17/46] scsi: csiostor: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/623cf762c73e [18/46] scsi: cxlflash: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/780c678912fb [19/46] scsi: fnic: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/d6ddcd8b38ab [20/46] scsi: hisi_sas: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/62ac8ccbb819 [21/46] scsi: hpsa: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/4cd16323b523 [22/46] scsi: hptiop: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/e8fbc28e7fc7 [23/46] scsi: ibmvscsi: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/c7da4e1cd040 [24/46] scsi: ibmvfc: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/7adbf68f4950 [25/46] scsi: ipr: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/47d1e6ae0e1e [26/46] scsi: isci: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/7eae6af530a6 [27/46] scsi: lpfc: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/08adfa753743 [28/46] scsi: megaraid: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/09723bb252ca [29/46] scsi: mpt3sas: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/1bb3ca27d2ca [30/46] scsi: mvsas: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/88b8132cff99 [31/46] scsi: myrb: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/582c0360db90 [32/46] scsi: myrs: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/087c3ace6337 [33/46] scsi: ncr53c8xx: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/aec4b25c8572 [34/46] scsi: sym53c500_cs: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/e71eebf744e4 [35/46] scsi: pm8001: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/c03b72b86c77 [36/46] scsi: pmcraid: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/646bed7e6f45 [37/46] scsi: qedf: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/232cb469d24e [38/46] scsi: qedi: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/1ebbd3b1d9a7 [39/46] scsi: qla2xxx: Remove a declaration https://git.kernel.org/mkp/scsi/c/f8f8f857e7df [40/46] scsi: qla2xxx: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/66df386d0b74 [41/46] scsi: qla4xxx: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/a8b476fc86d9 [42/46] scsi: smartpqi: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/64fc9015fbeb [43/46] scsi: snic: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/7500be62910d [44/46] scsi: unisys: Remove the shost_attrs member https://git.kernel.org/mkp/scsi/c/7ce6000a77cc [45/46] scsi: usb: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/01e570febaaa [46/46] scsi: core: Remove two host template members that are no longer used https://git.kernel.org/mkp/scsi/c/a47c6b713e89
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Missing driver-specific sysfs attributes of scsi_device [was: Re: [PATCH v4 00/46] Register SCSI sysfs attributes earlier]
Hi Bart, hi Martin,
since Friday 2021-10-22 our CI reports errors with linux-next. It complains about missing zfcp-lun resources (although that's a follow-on error). Machines that have their root-fs on zfcp-attached SCSI disk(s) are stuck in boot. Looking at user visible effects, I see zfcp-specific sysfs attributes of scsi_device missing:
$ lszfcp -D /usr/sbin/lszfcp: line 390: /sys/bus/ccw/drivers/zfcp/0.0.1780/host0/rport-0:0-0/target0:0:0/0:0:0:1089224725//hba_id: No such file or directory /usr/sbin/lszfcp: line 391: /sys/bus/ccw/drivers/zfcp/0.0.1780/host0/rport-0:0-0/target0:0:0/0:0:0:1089224725//wwpn: No such file or directory /usr/sbin/lszfcp: line 392: /sys/bus/ccw/drivers/zfcp/0.0.1780/host0/rport-0:0-0/target0:0:0/0:0:0:1089224725//fcp_lun: No such file or directory
That made me think of this patch series. It also happened so that Martin applied the series to 5.16/scsi-queue on 2021-10-21. Linux-next merged it on 2021-10-22:
Merging scsi-mkp/for-next (83c3a7beaef7 scsi: lpfc: Update lpfc version to 14.0.0.3)
$ git merge -m Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git scsi-mkp/for-next ... + drivers/s390/scsi/zfcp_ext.h | 4 +- + drivers/s390/scsi/zfcp_fsf.c | 2 +- + drivers/s390/scsi/zfcp_scsi.c | 8 +- + drivers/s390/scsi/zfcp_sysfs.c | 52 ++-- [https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20211022&id=cf6c9d12750cf6f3f6aeffcd0bdb36b1ac993f44]
So this seems to match with the occurrence of problems for us.
I wonder if any of the other LLDDs see similar problems. I left those LLDD patches in the list below, that also were migrated from sdev_attrs to sdev_groups.
Guess it would be good to fix this before the v5.16 merge window opens (2021-11-08 after predicted v5.15 release? [http://phb-crystal-ball.org/]) so the error does not land in Linus' tree (which our CI also tests).
Not sure if I'll find time to dig deeper.
Quoted 55 lines · Martin K. Petersen
Quoted 9 lines · Bart Van Assche
For certain user space software, e.g. udev, it is important that sysfs attributes are registered before the
KOBJ_ADDuevent is emitted. Hence this patch series that removes thedevice_create_file()andsysfs_create_groups()calls from the SCSI core. Please consider this patch series for kernel v5.16.Thanks,
[...]
Applied to 5.16/scsi-queue, thanks!
[01/46] scsi: core: Register sysfs attributes earlier
https://git.kernel.org/mkp/scsi/c/92c4b58b15c5 [02/46] ata: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/c3f69c7f629f [03/46] firewire: sbp2: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/5e88e67b6f3b[06/46] scsi: zfcp: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/d8d7cf3f7d07[10/46] scsi: 53c700: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/90cb6538b5da [11/46] scsi: aacraid: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/bd16d71185c8[18/46] scsi: cxlflash: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/780c678912fb[21/46] scsi: hpsa: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/4cd16323b523[25/46] scsi: ipr: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/47d1e6ae0e1e[28/46] scsi: megaraid: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/09723bb252ca [29/46] scsi: mpt3sas: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/1bb3ca27d2ca[31/46] scsi: myrb: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/582c0360db90 [32/46] scsi: myrs: Switch to attribute groups https://git.kernel.org/mkp/scsi/c/087c3ace6337[42/46] scsi: smartpqi: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/64fc9015fbeb[45/46] scsi: usb: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/01e570febaaa [46/46] scsi: core: Remove two host template members that are no longer used https://git.kernel.org/mkp/scsi/c/a47c6b713e89
Signature · 11 lines
Mit freundlichen Gruessen / Kind regards Steffen Maier Linux on IBM Z and LinuxONE https://www.ibm.com/privacy/us/en/ IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Gregor Pillen Geschaeftsfuehrung: Dirk Wittkopp Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
Re: Missing driver-specific sysfs attributes of scsi_device [was: Re: [PATCH v4 00/46] Register SCSI sysfs attributes earlier]
Quoted 9 lines · Steffen Maier
Hi Bart, hi Martin,
since Friday 2021-10-22 our CI reports errors with linux-next. It complains about missing zfcp-lun resources (although that's a follow-on error). Machines that have their root-fs on zfcp-attached SCSI disk(s) are stuck in boot. Looking at user visible effects, I see zfcp-specific sysfs attributes of
scsi_devicemissing:$ lszfcp -D /usr/sbin/lszfcp: line 390: /sys/bus/ccw/drivers/zfcp/0.0.1780/host0/rport-0:0-0/target0:0:0/0:0:0:1089224725//hba_id: No such file or directoryThat made me think of this patch series. It also happened so that Martin applied the series to 5.16/scsi-queue on 2021-10-21. Linux-next merged it on 2021-10-22:
Quoted 7 lines
So this seems to match with the occurrence of problems for us.
I wonder if any of the other LLDDs see similar problems. I left those LLDD patches in the list below, that also were migrated from
sdev_attrstosdev_groups.Guess it would be good to fix this before the v5.16 merge window opens (2021-11-08 after predicted v5.15 release? [http://phb-crystal-ball.org/]) so the error does not land in Linus' tree (which our CI also tests).
Not sure if I'll find time to dig deeper.
v4.17 commit 86b87cde0b55 ("scsi: core: host template attribute groups") introduced explicit sysfs_create_groups() in scsi_sysfs_add_sdev() and sysfs_remove_groups() in __scsi_remove_device(), both for sdev_gendev, based on a new field const struct attribute_group **sdev_groups of struct scsi_host_template.
Commit 92c4b58b15c5 ("scsi: core: Register sysfs attributes earlier") removed above explicit (de)registration of scsi_device attribute groups. It also converted all scsi_device attributes and attribute_groups to end up in a new field const struct attribute_group *gendev_attr_groups[6] of struct scsi_device. However, that new field is not used anywhere.
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.
However, that gave me:
Quoted 9 lines
Oct 24 02:06:20 t3545002 kernel: scsi 1:0:2:1090207765: scsi scan: INQUIRY pass 1 length 36 Oct 24 02:06:20 t3545002 kernel: scsi 1:0:2:1090207765: scsi scan: INQUIRY successful with code 0x0 Oct 24 02:06:20 t3545002 kernel: scsi 1:0:2:1090207765: scsi scan: INQUIRY pass 2 length 164 Oct 24 02:06:20 t3545002 kernel: scsi 1:0:2:1090207765: scsi scan: INQUIRY successful with code 0x0 Oct 24 02:06:20 t3545002 kernel: scsi 1:0:2:1090207765: Direct-Access IBM 2107900 2.19 PQ: 0 ANSI: 5 Oct 24 02:06:20 t3545002 kernel: scsi 1:0:2:1090207765: alua: supports implicit TPGS Oct 24 02:06:20 t3545002 kernel: scsi 1:0:2:1090207765: alua: device naa.6005076309ffd43000000000000015fb port group 0 rel port 103 Oct 24 02:06:20 t3545002 kernel: sysfs: cannot create duplicate filename '/devices/css0/0.0.0019/0.0.1880/host1/rport-1:0-2/target1:0:2/1:0:2:1090207765/device_blocked' Oct 24 02:06:20 t3545002 kernel: CPU: 1 PID: 1530 Comm: chzdev Not tainted 5.15.0-rc1sdevattr+ #29
Quoted 8 lines
Oct 24 02:06:20 t3545002 kernel: Hardware name: IBM 8561 T01 703 (z/VM 7.2.0)
Oct 24 02:06:20 t3545002 kernel: Call Trace:
Oct 24 02:06:20 t3545002 kernel: [<00000000701c923e>] dump_stack_lvl+0x8e/0xc8 Oct 24 02:06:20 t3545002 kernel: [<000000006f991408>] sysfs_warn_dup+0x78/0x88 Oct 24 02:06:20 t3545002 kernel: [<000000006f990fb0>] sysfs_add_file_mode_ns+0x1c8/0x1e8 Oct 24 02:06:20 t3545002 kernel: [<000000006f991e3c>] create_files+0xb4/0x230 Oct 24 02:06:20 t3545002 kernel: [<000000006f992068>] internal_create_group+0xb0/0x1e8 Oct 24 02:06:20 t3545002 kernel: [<000000006f9928b0>] internal_create_groups.part.0+0x60/0xc8 Oct 24 02:06:20 t3545002 kernel: [<000000006fe807ca>] device_add_attrs+0x72/0x1d0 Oct 24 02:06:20 t3545002 kernel: [<000000006fe85168>] device_add+0x360/0x690 Oct 24 02:06:20 t3545002 kernel: [<000003ff801429b0>] scsi_sysfs_add_sdev+0x60/0x1a0 [scsi_mod] Oct 24 02:06:20 t3545002 kernel: [<000003ff8013d870>] scsi_add_lun+0x3b0/0x5d0 [scsi_mod] Oct 24 02:06:20 t3545002 kernel: [<000003ff8013e62c>] scsi_probe_and_add_lun+0x184/0x4a0 [scsi_mod] Oct 24 02:06:20 t3545002 kernel: [<000003ff8013f4ec>] __scsi_scan_target+0x9c/0x240 [scsi_mod] Oct 24 02:06:20 t3545002 kernel: [<000003ff8013f76a>] scsi_scan_target+0xda/0xf8 [scsi_mod] Oct 24 02:06:20 t3545002 kernel: [<000003ff802d2a9c>] zfcp_unit_scsi_scan+0x6c/0x78 [zfcp] Oct 24 02:06:20 t3545002 kernel: [<000003ff802d2e32>] zfcp_unit_add+0x1ea/0x220 [zfcp] Oct 24 02:06:20 t3545002 kernel: [<000003ff802d0f3c>] zfcp_sysfs_unit_add_store+0x4c/0x70 [zfcp] Oct 24 02:06:20 t3545002 kernel: [<000000006f98f946>] kernfs_fop_write_iter+0x13e/0x1e0 Oct 24 02:06:20 t3545002 kernel: [<000000006f899ff8>] new_sync_write+0x100/0x190 Oct 24 02:06:20 t3545002 kernel: [<000000006f89ced0>] vfs_write+0x230/0x2e0 Oct 24 02:06:20 t3545002 kernel: [<000000006f89d1ec>] ksys_write+0x6c/0xf8 Oct 24 02:06:20 t3545002 kernel: [<00000000701cc7ba>] __do_syscall+0x1c2/0x1f0 Oct 24 02:06:20 t3545002 kernel: [<00000000701df168>] system_call+0x78/0xa0 Oct 24 02:06:20 t3545002 kernel: 4 locks held by chzdev/1530:
Oct 24 02:06:20 t3545002 kernel: #0: 0000000003711498 (sb_writers#3){.+.+}-{0:0}, at: ksys_write+0x6c/0xf8
Oct 24 02:06:20 t3545002 kernel: #1: 000000000e77fa90 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x102/0x1e0
Oct 24 02:06:20 t3545002 kernel: #2: 0000000035754e10 (kn->active#83){++++}-{0:0}, at: kernfs_fop_write_iter+0x10e/0x1e0
Oct 24 02:06:20 t3545002 kernel: #3: 0000000031bf90f0 (&shost->scan_mutex){+.+.}-{3:3}, at: scsi_scan_target+0x90/0xf8 [scsi_mod]
Oct 24 02:06:20 t3545002 kernel: scsi 1:0:2:1090207765: failed to add device: -17So I suspected that sdev_gendev is not a good idea and tried with its child sdev_dev instead. But now I'm back at square one with the attributes missing.
Where can I read about sdev_gendev vs. sdev_dev in a hopefully easy to understand way?
And how do we get to pass our scsi_device.gendev_attr_groups to the driver core to appear in sysfs?
Quoted 56 lines · Martin K. Petersen
Quoted 55 lines · Bart Van Assche
Quoted 10 lines
For certain user space software, e.g. udev, it is important that sysfs attributes are registered before the
KOBJ_ADDuevent is emitted. Hence this patch series that removes thedevice_create_file()andsysfs_create_groups()calls from the SCSI core. Please consider this patch series for kernel v5.16.Thanks,
[...]
Applied to 5.16/scsi-queue, thanks!
[01/46] scsi: core: Register sysfs attributes earlier
https://git.kernel.org/mkp/scsi/c/92c4b58b15c5
[02/46] ata: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/c3f69c7f629f
[03/46] firewire: sbp2: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/5e88e67b6f3b[06/46] scsi: zfcp: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/d8d7cf3f7d07[10/46] scsi: 53c700: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/90cb6538b5da
[11/46] scsi: aacraid: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/bd16d71185c8[18/46] scsi: cxlflash: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/780c678912fb[21/46] scsi: hpsa: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/4cd16323b523[25/46] scsi: ipr: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/47d1e6ae0e1e[28/46] scsi: megaraid: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/09723bb252ca
[29/46] scsi: mpt3sas: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/1bb3ca27d2ca[31/46] scsi: myrb: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/582c0360db90
[32/46] scsi: myrs: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/087c3ace6337[42/46] scsi: smartpqi: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/64fc9015fbeb[45/46] scsi: usb: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/01e570febaaa
[46/46] scsi: core: Remove two host template members that are no longer used
https://git.kernel.org/mkp/scsi/c/a47c6b713e89
Signature · 11 lines
Mit freundlichen Gruessen / Kind regards Steffen Maier Linux on IBM Z and LinuxONE https://www.ibm.com/privacy/us/en/ IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Gregor Pillen Geschaeftsfuehrung: Dirk Wittkopp Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
Bart Van Assche
maintainerRe: Missing driver-specific sysfs attributes of scsi_device [was: Re: [PATCH v4 00/46] Register SCSI sysfs attributes earlier]
Quoted 5 lines · Steffen Maier
I tried to fix it by assigning the pointer of that new field to the groups field of
sdev_gendevso the driver core gets our groups ondevide_add(). Just likescsi_host_alloc()was changed by the same commit, althoughscsi_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):
drivers/scsi/scsi_sysfs.c +1 -1
@@ -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.
PATCH 1/1 scsi: core: Fix early registration of sysfs attributes for scsi_device
In reply to Steffen Maierv4.17 commit 86b87cde0b55 ("scsi: core: host template attribute groups") introduced explicit sysfs_create_groups() in scsi_sysfs_add_sdev() and sysfs_remove_groups() in __scsi_remove_device(), both for sdev_gendev, based on a new field const struct attribute_group **sdev_groups of struct scsi_host_template.
Commit 92c4b58b15c5 ("scsi: core: Register sysfs attributes earlier") removed above explicit (de)registration of scsi_device attribute groups. It also converted all scsi_device attributes and attribute_groups to end up in a new field const struct attribute_group *gendev_attr_groups[6] of struct scsi_device. However, that new field was not used anywhere.
Surprisingly, this only caused missing LLDD specific scsi_device sysfs attributes. Whereas, scsi core attributes from scsi_sdev_attr_groups did continue to exist because of scsi_dev_type.groups.
Fix it by assigning the pointer of that new field to the groups field of sdev_gendev so the driver core gets our LLDD groups. 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.
We separate scsi core attibutes from LLDD specific attributes. Hence, we keep the initializing assignment scsi_dev_type = { .groups = scsi_sdev_attr_groups, } as this takes care of core attributes. Without the separation, it would cause attribute double registration due to scsi_dev_type.groups and sdev_gendev.groups.
Alternative approaches ruled out:
Assigning gendev_attr_groups to sdev_dev has no visible effect. Assigning sdev->gendev_attr_groups to scsi_dev_type.groups caused scsi_device of all scsi host types to get LLDD specific attributes of the LLDD for which the last sdev alloc happened to occur, as that overwrote scsi_dev_type.groups,
e.g. scsi_debug had zfcp-specific scsi_device attributes.
--- drivers/scsi/scsi_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_sysfs.c +1 -1
@@ -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);
Signature · 1 line
2.25.1
Bart Van Assche
maintainerRe: [PATCH] scsi: core: Fix early registration of sysfs attributes for scsi_device
drivers/scsi/scsi_sysfs.c void scsi_sysfs_device_initialize(struct scsi_device *sdev) · line 1589
Quoted 13 lines · Steffen Maier
drivers/scsi/scsi_sysfs.c +1
-1@@ -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);
How about also updating the comment above the gendev_attr_groups declaration since the above change makes that comment incorrect?
Thanks,
Bart.
PATCH v2 1/1 scsi: core: Fix early registration of sysfs attributes for scsi_device
v4.17 commit 86b87cde0b55 ("scsi: core: host template attribute groups") introduced explicit sysfs_create_groups() in scsi_sysfs_add_sdev() and sysfs_remove_groups() in __scsi_remove_device(), both for sdev_gendev, based on a new field const struct attribute_group **sdev_groups of struct scsi_host_template.
Commit 92c4b58b15c5 ("scsi: core: Register sysfs attributes earlier") removed above explicit (de)registration of scsi_device attribute groups. It also converted all scsi_device attributes and attribute_groups to end up in a new field const struct attribute_group *gendev_attr_groups[6] of struct scsi_device. However, that new field was not used anywhere.
Surprisingly, this only caused missing LLDD specific scsi_device sysfs attributes. Whereas, scsi core attributes from scsi_sdev_attr_groups did continue to exist because of scsi_dev_type.groups.
Fix it by assigning the pointer of that new field to the groups field of sdev_gendev so the driver core gets our LLDD groups. 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.
We separate scsi core attibutes from LLDD specific attributes. Hence, we keep the initializing assignment scsi_dev_type = { .groups = scsi_sdev_attr_groups, } as this takes care of core attributes. Without the separation, it would cause attribute double registration due to scsi_dev_type.groups and sdev_gendev.groups.
Since we now no longer have an index offset between left and right hand side of the assignment in the loop, one counter variable suffices.
Alternative approaches ruled out:
Assigning gendev_attr_groups to sdev_dev has no visible effect. Assigning sdev->gendev_attr_groups to scsi_dev_type.groups caused scsi_device of all scsi host types to get LLDD specific attributes of the LLDD for which the last sdev alloc happened to occur, as that overwrote scsi_dev_type.groups,
e.g. scsi_debug had zfcp-specific scsi_device attributes.
---
Changes in v2:
* integrated Bart's feedback of updating the comment for the gendev_attr_groups declaration to match the code change
* in that spirit also adapted the vector size of that field
* eliminated the now unnecessary second loop counter 'j'
drivers/scsi/scsi_sysfs.c | 12 ++++++------ include/scsi/scsi_device.h | 7 +++---- 2 files changed, 9 insertions(+), 10 deletions(-)
drivers/scsi/scsi_sysfs.c +6 -6
@@ -1571,7 +1571,7 @@ static struct device_type scsi_dev_type = {void scsi_sysfs_device_initialize (struct scsi_device *sdev) { -int i, j =0 ; +int i =0 ;unsigned long flags;struct Scsi_Host *shost = sdev->host;struct scsi_host_template *hostt = shost->hostt;
@@ -1583,15 +1583,15 @@ 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); - i++, j++) { - sdev->gendev_attr_groups[j] = hostt->sdev_groups[i]; + i <ARRAY_SIZE (sdev->gendev_attr_groups); + i++) { + sdev->gendev_attr_groups[i] = hostt->sdev_groups[i]; } } -WARN_ON_ONCE (j >=ARRAY_SIZE (sdev->gendev_attr_groups)); +WARN_ON_ONCE (i >=ARRAY_SIZE (sdev->gendev_attr_groups));device_initialize (&sdev->sdev_dev); sdev->sdev_dev.parent =get_device (&sdev->sdev_gendev);
include/scsi/scsi_device.h +3 -4
@@ -226,11 +226,10 @@ struct scsi_device {struct device sdev_gendev, sdev_dev;/* -* The array size 6 provides space for one attribute group for the -* SCSI core, four attribute groups defined by SCSI LLDs and one -* terminating NULL pointer. +* The array size 5 provides space for four attribute groups +* defined by SCSI LLDs and one terminating NULL pointer. */ -const struct attribute_group *gendev_attr_groups[6 ]; +const struct attribute_group *gendev_attr_groups[5 ];struct execute_work ew;/* used to get process context on put */ struct work_struct requeue_work;
Signature · 1 line
2.25.1
Re: [PATCH v2] scsi: core: Fix early registration of sysfs attributes for scsi_device
Quoted 6 lines · Steffen Maier
v4.17 commit
86b87cde0b55("scsi: core: host template attribute groups") introduced explicitsysfs_create_groups()inscsi_sysfs_add_sdev()andsysfs_remove_groups()in__scsi_remove_device(), both forsdev_gendev, based on a new field const structattribute_group**sdev_groups of structscsi_host_template.
...
Quoted 36 lines
Signed-off-by Steffen Maier <[email protected]>Fixes 92c4b58b15c5 ("scsi: core: Register sysfs attributes earlier")---
Changes in v2:
* integrated Bart's feedback of updating the comment for thegendev_attr_groupsdeclaration to match the code change
* in that spirit also adapted the vector size of that field
* eliminated the now unnecessary second loop counter 'j'drivers/scsi/scsi_sysfs.c | 12 ++++++------ include/scsi/scsi_device.h | 7 +++---- 2 files changed, 9 insertions(+), 10 deletions(-)drivers/scsi/scsi_sysfs.c +2
-3@@ -1571,7 +1571,7 @@ static struct device_type scsi_dev_type = {void scsi_sysfs_device_initialize (struct scsi_device *sdev) { -int i, j =0 ; +int i =0 ;unsigned long flags;struct Scsi_Host *shost = sdev->host;struct scsi_host_template *hostt = shost->hostt;@@ -1583,15 +1583,15 @@ 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);
drivers/scsi/scsi_sysfs.c void scsi_sysfs_device_initialize(struct scsi_device *sdev) · line 1595
Quoted 10 lines
drivers/scsi/scsi_sysfs.c +4
-3- i++, j++) { - sdev->gendev_attr_groups[j] = hostt->sdev_groups[i]; + i <ARRAY_SIZE (sdev->gendev_attr_groups); + i++) { + sdev->gendev_attr_groups[i] = hostt->sdev_groups[i]; } } -WARN_ON_ONCE (j >=ARRAY_SIZE (sdev->gendev_attr_groups)); +WARN_ON_ONCE (i >=ARRAY_SIZE (sdev->gendev_attr_groups));
Can't we simply assign the hostt->sdev_groups now, without the additional indirection?
sdev->sdev_gendev.groups = hostt->sdev_groups;
Quoted 22 lines
drivers/scsi/scsi_sysfs.c +0
-0device_initialize (&sdev->sdev_dev); sdev->sdev_dev.parent =get_device (&sdev->sdev_gendev);include/scsi/scsi_device.h +3
-4@@ -226,11 +226,10 @@ struct scsi_device {struct device sdev_gendev, sdev_dev;/* -* The array size 6 provides space for one attribute group for the -* SCSI core, four attribute groups defined by SCSI LLDs and one -* terminating NULL pointer. +* The array size 5 provides space for four attribute groups +* defined by SCSI LLDs and one terminating NULL pointer. */ -const struct attribute_group *gendev_attr_groups[6 ]; +const struct attribute_group *gendev_attr_groups[5 ];struct execute_work ew;/* used to get process context on put */ struct work_struct requeue_work;
Bart Van Assche
maintainerRe: [PATCH v2] scsi: core: Fix early registration of sysfs attributes for scsi_device
Quoted 31 lines · Julian Wiedmann
Quoted 16 lines · Steffen Maier
void scsi_sysfs_device_initialize(struct scsi_device *sdev) {drivers/scsi/scsi_sysfs.c +2
-3-int i, j =0 ; +int i =0 ;unsigned long flags;struct Scsi_Host *shost = sdev->host;struct scsi_host_template *hostt = shost->hostt;@@ -1583,15 +1583,15 @@ 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);drivers/scsi/scsi_sysfs.c void scsi_sysfs_device_initialize(struct scsi_device *sdev) · line 1595
Quoted 10 lines
drivers/scsi/scsi_sysfs.c +4
-3- i++, j++) { - sdev->gendev_attr_groups[j] = hostt->sdev_groups[i]; + i <ARRAY_SIZE (sdev->gendev_attr_groups); + i++) { + sdev->gendev_attr_groups[i] = hostt->sdev_groups[i]; } } -WARN_ON_ONCE (j >=ARRAY_SIZE (sdev->gendev_attr_groups)); +WARN_ON_ONCE (i >=ARRAY_SIZE (sdev->gendev_attr_groups));Can't we simply assign the
hostt->sdev_groupsnow, without the additional indirection?
Quoted 1 line
sdev->sdev_gendev.groups=hostt->sdev_groups;
Hi Steffen,
Please let me know if you wouldn't have the time to integrate the approach mentioned above in a new version of your patch.
Thanks,
Bart.
PATCH v3 1/1 scsi: core: Fix early registration of sysfs attributes for scsi_device
In reply to Julian Wiedmannv4.17 commit 86b87cde0b55 ("scsi: core: host template attribute groups") introduced explicit sysfs_create_groups() in scsi_sysfs_add_sdev() and sysfs_remove_groups() in __scsi_remove_device(), both for sdev_gendev, based on a new field const struct attribute_group **sdev_groups of struct scsi_host_template.
Commit 92c4b58b15c5 ("scsi: core: Register sysfs attributes earlier") removed above explicit (de)registration of scsi_device attribute groups. It also converted all scsi_device attributes and attribute_groups to end up in a new field const struct attribute_group *gendev_attr_groups[6] of struct scsi_device. However, that new field was not used anywhere.
Surprisingly, this only caused missing LLDD specific scsi_device sysfs attributes. Whereas, scsi core attributes from scsi_sdev_attr_groups did continue to exist because of scsi_dev_type.groups.
We separate scsi core attibutes from LLDD specific attributes. Hence, we keep the initializing assignment scsi_dev_type = { .groups = scsi_sdev_attr_groups, } as this takes care of core attributes. Without the separation, it would cause attribute double registration due to scsi_dev_type.groups and sdev_gendev.groups.
Julian suggested to assign the sdev_groups pointer of the scsi_host_template directly to the groups pointer of sdev_gendev. This way we can delete the container scsi_device.gendev_attr_groups and the loop copying each entry from hostt->sdev_groups to sdev->gendev_attr_groups.
Alternative approaches ruled out:
Assigning gendev_attr_groups to sdev_dev has no visible effect. Assigning sdev->gendev_attr_groups to scsi_dev_type.groups caused scsi_device of all scsi host types to get LLDD specific attributes of the LLDD for which the last sdev alloc happened to occur, as that overwrote scsi_dev_type.groups,
e.g. scsi_debug had zfcp-specific scsi_device attributes.
---
Notes:
Changes in v3:
* integrated Julian's feedback of dropping detour through gendev_attr_groups
Changes in v2:
* integrated Bart's feedback of updating the comment for the gendev_attr_groups declaration to match the code change
* in that spirit also adapted the vector size of that field
* eliminated the now unnecessary second loop counter 'j'
drivers/scsi/scsi_sysfs.c | 11 +---------- include/scsi/scsi_device.h | 6 ------ 2 files changed, 1 insertion(+), 16 deletions(-)
drivers/scsi/scsi_sysfs.c +1 -10
@@ -1571,7 +1571,6 @@ static struct device_type scsi_dev_type = {void scsi_sysfs_device_initialize (struct scsi_device *sdev) { -int i, j =0 ;unsigned long flags;struct Scsi_Host *shost = sdev->host;struct scsi_host_template *hostt = shost->hostt;
@@ -1583,15 +1582,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; -if (hostt->sdev_groups) { -for (i =0 ; hostt->sdev_groups[i] && - j <ARRAY_SIZE (sdev->gendev_attr_groups); - i++, j++) { - sdev->gendev_attr_groups[j] = hostt->sdev_groups[i]; - } - } -WARN_ON_ONCE (j >=ARRAY_SIZE (sdev->gendev_attr_groups)); + sdev->sdev_gendev.groups = hostt->sdev_groups;device_initialize (&sdev->sdev_dev); sdev->sdev_dev.parent =get_device (&sdev->sdev_gendev);
include/scsi/scsi_device.h +0 -6
@@ -225,12 +225,6 @@ struct scsi_device {struct device sdev_gendev, sdev_dev; -/* -* The array size 6 provides space for one attribute group for the -* SCSI core, four attribute groups defined by SCSI LLDs and one -* terminating NULL pointer. -*/ -const struct attribute_group *gendev_attr_groups[6 ];struct execute_work ew;/* used to get process context on put */ struct work_struct requeue_work;
Signature · 1 line
2.25.1
Re: [PATCH v3] scsi: core: Fix early registration of sysfs attributes for scsi_device
Quoted 11 lines · Steffen Maier
v4.17 commit
86b87cde0b55("scsi: core: host template attribute groups") introduced explicitsysfs_create_groups()inscsi_sysfs_add_sdev()andsysfs_remove_groups()in__scsi_remove_device(), both forsdev_gendev, based on a new field const structattribute_group**sdev_groups of structscsi_host_template.Commit
92c4b58b15c5("scsi: core: Register sysfs attributes earlier") removed above explicit (de)registration ofscsi_deviceattribute groups. It also converted allscsi_deviceattributes andattribute_groupsto end up in a new field const structattribute_group*gendev_attr_groups[6] of structscsi_device. However, that new field was not used anywhere.
Oh.. damn, I didn't notice either.
Quoted 4 lines
Surprisingly, this only caused missing LLDD specific
scsi_devicesysfs attributes. Whereas, scsi core attributes fromscsi_sdev_attr_groupsdid continue to exist because of scsi_dev_type.groups.
Hmm, maybe this is out of scope for this fix, but couldn't we essentially do the same thing for the host attributes. Have the shost_class take the scsi_shost_attr_group as default attributes for the shost class, and then assign the shost_groups from the LLDD template to shost_dev.groups as optional attributes?
Then we get rid of the indirection loop in hosts.c as well, that was introduce with he original patch by Bart.
Just a shot in the dark, I don't know whether the struct class behaves the same in this case as struct device_type.
Quoted 24 lines
We separate scsi core attibutes from LLDD specific attributes. Hence, we keep the initializing assignment
scsi_dev_type= { .groups =scsi_sdev_attr_groups, } as this takes care of core attributes. Without the separation, it would cause attribute double registration due to scsi_dev_type.groups and sdev_gendev.groups.Julian suggested to assign the
sdev_groupspointer of thescsi_host_templatedirectly to the groups pointer ofsdev_gendev. This way we can delete the container scsi_device.gendev_attr_groups and the loop copying each entry fromhostt->sdev_groupstosdev->gendev_attr_groups.Alternative approaches ruled out:
Assigninggendev_attr_groupstosdev_devhas no visible effect. Assigningsdev->gendev_attr_groupsto scsi_dev_type.groups causedscsi_deviceof all scsi host types to get LLDD specific attributes of the LLDD for which the last sdev alloc happened to occur, as that overwrote scsi_dev_type.groups,
e.g.scsi_debughad zfcp-specificscsi_deviceattributes.Signed-off-by Steffen Maier <[email protected]>Fixes 92c4b58b15c5 ("scsi: core: Register sysfs attributes earlier")Suggested-by Julian Wiedmann <[email protected]>
Signature · 4 lines
Best Regards, Benjamin Block / Linux on IBM Z Kernel Development / IBM Systems IBM Deutschland Research & Development GmbH / https://www.ibm.com/privacy Vorsitz. AufsR.: Gregor Pillen / Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294
Bart Van Assche
maintainerRe: [PATCH v3] scsi: core: Fix early registration of sysfs attributes for scsi_device
Quoted 11 lines · Benjamin Block
Hmm, maybe this is out of scope for this fix, but couldn't we essentially do the same thing for the host attributes. Have the
shost_classtake thescsi_shost_attr_groupas default attributes for the shost class, and then assign theshost_groupsfrom the LLDD template toshost_dev.groupsas optional attributes?Then we get rid of the indirection loop in
hosts.cas well, that was introduce with he original patch by Bart.Just a shot in the dark, I don't know whether the
struct classbehaves the same in this case asstruct device_type.
Is something like this what you have in mind?
Thanks,
Bart.
Subject: [PATCH] scsi: core: Remove Scsi_Host.shost_dev_attr_groups
--- drivers/scsi/hosts.c | 15 +++------------ drivers/scsi/scsi_priv.h | 2 +- drivers/scsi/scsi_sysfs.c | 7 ++++++- include/scsi/scsi_host.h | 6 ------ 4 files changed, 10 insertions(+), 20 deletions(-)
drivers/scsi/hosts.c +3 -12
@@ -61,6 +61,7 @@ static void scsi_host_cls_release(struct device *dev)static struct class shost_class = { .name ="scsi_host" , .dev_release = scsi_host_cls_release, + .dev_groups = scsi_shost_groups, };/**
@@ -376,7 +377,7 @@ static struct device_type scsi_host_type = {struct Scsi_Host *scsi_host_alloc (struct scsi_host_template *sht,int privsize) {struct Scsi_Host *shost; -int index, i, j =0 ; +int index; shost =kzalloc (sizeof (struct Scsi_Host ) + privsize,GFP_KERNEL );if (!shost)
@@ -481,17 +482,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) shost->shost_dev.parent = &shost->shost_gendev; shost->shost_dev.class = &shost_class;dev_set_name (&shost->shost_dev,"host%d" , shost->host_no); - shost->shost_dev.groups = shost->shost_dev_attr_groups; - shost->shost_dev_attr_groups[j++] = &scsi_shost_attr_group; -if (sht->shost_groups) { -for (i =0 ; sht->shost_groups[i] && - j <ARRAY_SIZE (shost->shost_dev_attr_groups); - i++, j++) { - shost->shost_dev_attr_groups[j] = - sht->shost_groups[i]; - } - } -WARN_ON_ONCE (j >=ARRAY_SIZE (shost->shost_dev_attr_groups)); + shost->shost_dev.groups = sht->shost_groups; shost->ehandler =kthread_run (scsi_error_handler, shost,"scsi_eh_%d" , shost->host_no);
drivers/scsi/scsi_priv.h +1 -1
@@ -144,7 +144,7 @@ extern struct scsi_transport_template blank_transport_template;extern void __scsi_remove_device (struct scsi_device *);extern struct bus_type scsi_bus_type; -extern const struct attribute_group scsi_shost_attr_group; +extern const struct attribute_group *scsi_shost_groups[];/* scsi_netlink.c */ #ifdef CONFIG_SCSI_NETLINK
drivers/scsi/scsi_sysfs.c +6 -1
@@ -424,10 +424,15 @@ static struct attribute *scsi_sysfs_shost_attrs[] = { NULL }; -const struct attribute_group scsi_shost_attr_group = { +static const struct attribute_group scsi_shost_attr_group = { .attrs = scsi_sysfs_shost_attrs, }; +const struct attribute_group *scsi_shost_groups[] = { + &scsi_shost_attr_group, +NULL +}; +static void scsi_device_cls_release (struct device *class_dev) {struct scsi_device *sdev;
include/scsi/scsi_host.h +0 -6
@@ -690,12 +690,6 @@ struct Scsi_Host {/* ldm bits */ struct device shost_gendev, shost_dev; -/* -* The array size 3 provides space for one attribute group defined by -* the SCSI core, one attribute group defined by the SCSI LLD and one -* terminating NULL pointer. -*/ -const struct attribute_group *shost_dev_attr_groups[3 ];/* * Points to the transport data (if any) which is allocated
Benjamin Block
Reviewed-byRe: [PATCH v3] scsi: core: Fix early registration of sysfs attributes for scsi_device
Quoted 7 lines · Bart Van Assche
Quoted 6 lines · Benjamin Block
Hmm, maybe this is out of scope for this fix, but couldn't we essentially do the same thing for the host attributes. Have the
shost_classtake thescsi_shost_attr_groupas default attributes for the shost class, and then assign theshost_groupsfrom the LLDD template toshost_dev.groupsas optional attributes?
Quoted 7 lines
Quoted 5 lines
Then we get rid of the indirection loop in
hosts.cas well, that was introduce with he original patch by Bart.Just a shot in the dark, I don't know whether the
struct classbehaves the same in this case asstruct device_type.Is something like this what you have in mind?
Yes, exactly. That's what I meant. That make host and dev similar again.
I just wasn't really sure whether .dev_groups in class behaves the same as with what Steffen did. From the documentation it does though.
Quoted 98 lines
Thanks,
Bart.
Subject: [PATCH] scsi: core: Remove Scsi_Host.shost_dev_attr_groups
Suggested-by Benjamin Block <[email protected]>Signed-off-by Bart Van Assche <[email protected]>--- drivers/scsi/hosts.c | 15 +++------------ drivers/scsi/scsi_priv.h | 2 +- drivers/scsi/scsi_sysfs.c | 7 ++++++- include/scsi/scsi_host.h | 6 ------ 4 files changed, 10 insertions(+), 20 deletions(-)drivers/scsi/hosts.c +3
-12@@ -61,6 +61,7 @@ static void scsi_host_cls_release(struct device *dev)static struct class shost_class = { .name ="scsi_host" , .dev_release = scsi_host_cls_release, + .dev_groups = scsi_shost_groups, };/** @@ -376,7 +377,7 @@ static struct device_type scsi_host_type = {struct Scsi_Host *scsi_host_alloc (struct scsi_host_template *sht,int privsize) {struct Scsi_Host *shost; -int index, i, j =0 ; +int index; shost =kzalloc (sizeof (struct Scsi_Host ) + privsize,GFP_KERNEL );if (!shost)@@ -481,17 +482,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) shost->shost_dev.parent = &shost->shost_gendev; shost->shost_dev.class = &shost_class;dev_set_name (&shost->shost_dev,"host%d" , shost->host_no); - shost->shost_dev.groups = shost->shost_dev_attr_groups; - shost->shost_dev_attr_groups[j++] = &scsi_shost_attr_group; -if (sht->shost_groups) { -for (i =0 ; sht->shost_groups[i] && - j <ARRAY_SIZE (shost->shost_dev_attr_groups); - i++, j++) { - shost->shost_dev_attr_groups[j] = - sht->shost_groups[i]; - } - } -WARN_ON_ONCE (j >=ARRAY_SIZE (shost->shost_dev_attr_groups)); + shost->shost_dev.groups = sht->shost_groups; shost->ehandler =kthread_run (scsi_error_handler, shost,"scsi_eh_%d" , shost->host_no);drivers/scsi/scsi_priv.h +1
-1@@ -144,7 +144,7 @@ extern struct scsi_transport_template blank_transport_template;extern void __scsi_remove_device (struct scsi_device *);extern struct bus_type scsi_bus_type; -extern const struct attribute_group scsi_shost_attr_group; +extern const struct attribute_group *scsi_shost_groups[];/* scsi_netlink.c */ #ifdef CONFIG_SCSI_NETLINK drivers/scsi/scsi_sysfs.c +6
-1@@ -424,10 +424,15 @@ static struct attribute *scsi_sysfs_shost_attrs[] = { NULL }; -const struct attribute_group scsi_shost_attr_group = { +static const struct attribute_group scsi_shost_attr_group = { .attrs = scsi_sysfs_shost_attrs, }; +const struct attribute_group *scsi_shost_groups[] = { + &scsi_shost_attr_group, +NULL +}; +static void scsi_device_cls_release (struct device *class_dev) {struct scsi_device *sdev;include/scsi/scsi_host.h +0
-0@@ -690,12 +690,6 @@ struct Scsi_Host {/* ldm bits */
include/scsi/scsi_host.h struct Scsi_Host { · line 695
Quoted 10 lines
include/scsi/scsi_host.h +0
-6struct device shost_gendev, shost_dev; -/* -* The array size 3 provides space for one attribute group defined by -* the SCSI core, one attribute group defined by the SCSI LLD and one -* terminating NULL pointer. -*/ -const struct attribute_group *shost_dev_attr_groups[3 ];/* * Points to the transport data (if any) which is allocated
Signature · 4 lines
Best Regards, Benjamin Block / Linux on IBM Z Kernel Development / IBM Systems IBM Deutschland Research & Development GmbH / https://www.ibm.com/privacy Vorsitz. AufsR.: Gregor Pillen / Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294
Re: [PATCH v3] scsi: core: Fix early registration of sysfs attributes for scsi_device
In reply to Steffen MaierQuoted 36 lines · Steffen Maier
drivers/scsi/scsi_sysfs.c +1
-10@@ -1571,7 +1571,6 @@ static struct device_type scsi_dev_type = {void scsi_sysfs_device_initialize (struct scsi_device *sdev) { -int i, j =0 ;unsigned long flags;struct Scsi_Host *shost = sdev->host;struct scsi_host_template *hostt = shost->hostt;@@ -1583,15 +1582,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; -if (hostt->sdev_groups) { -for (i =0 ; hostt->sdev_groups[i] && - j <ARRAY_SIZE (sdev->gendev_attr_groups); - i++, j++) { - sdev->gendev_attr_groups[j] = hostt->sdev_groups[i]; - } - } -WARN_ON_ONCE (j >=ARRAY_SIZE (sdev->gendev_attr_groups)); + sdev->sdev_gendev.groups = hostt->sdev_groups;device_initialize (&sdev->sdev_dev); sdev->sdev_dev.parent =get_device (&sdev->sdev_gendev);include/scsi/scsi_device.h +0
-0@@ -225,12 +225,6 @@ struct scsi_device { struct device sdev_gendev,
include/scsi/scsi_device.h struct scsi_device { · line 230
Quoted 10 lines
include/scsi/scsi_device.h +0
-6sdev_dev; -/* -* The array size 6 provides space for one attribute group for the -* SCSI core, four attribute groups defined by SCSI LLDs and one -* terminating NULL pointer. -*/ -const struct attribute_group *gendev_attr_groups[6 ];struct execute_work ew;/* used to get process context on put */ struct work_struct requeue_work;
Thanks!
Re: [PATCH v3] scsi: core: Fix early registration of sysfs attributes for scsi_device
In reply to Steffen MaierQuoted 52 lines · Steffen Maier
v4.17 commit
86b87cde0b55("scsi: core: host template attribute groups") introduced explicitsysfs_create_groups()inscsi_sysfs_add_sdev()andsysfs_remove_groups()in__scsi_remove_device(), both forsdev_gendev, based on a new field const structattribute_group**sdev_groups of structscsi_host_template.Commit
92c4b58b15c5("scsi: core: Register sysfs attributes earlier") removed above explicit (de)registration ofscsi_deviceattribute groups. It also converted allscsi_deviceattributes andattribute_groupsto end up in a new field const structattribute_group*gendev_attr_groups[6] of structscsi_device. However, that new field was not used anywhere.Surprisingly, this only caused missing LLDD specific
scsi_devicesysfs attributes. Whereas, scsi core attributes fromscsi_sdev_attr_groupsdid continue to exist because of scsi_dev_type.groups.We separate scsi core attibutes from LLDD specific attributes. Hence, we keep the initializing assignment
scsi_dev_type= { .groups =scsi_sdev_attr_groups, } as this takes care of core attributes. Without the separation, it would cause attribute double registration due to scsi_dev_type.groups and sdev_gendev.groups.Julian suggested to assign the
sdev_groupspointer of thescsi_host_templatedirectly to the groups pointer ofsdev_gendev. This way we can delete the container scsi_device.gendev_attr_groups and the loop copying each entry fromhostt->sdev_groupstosdev->gendev_attr_groups.Alternative approaches ruled out:
Assigninggendev_attr_groupstosdev_devhas no visible effect. Assigningsdev->gendev_attr_groupsto scsi_dev_type.groups causedscsi_deviceof all scsi host types to get LLDD specific attributes of the LLDD for which the last sdev alloc happened to occur, as that overwrote scsi_dev_type.groups,
e.g.scsi_debughad zfcp-specificscsi_deviceattributes.Signed-off-by Steffen Maier <[email protected]>Fixes 92c4b58b15c5 ("scsi: core: Register sysfs attributes earlier")Suggested-by Julian Wiedmann <[email protected]>---
Notes:
Changes in v3:
* integrated Julian's feedback of dropping detour throughgendev_attr_groupsChanges in v2:
* integrated Bart's feedback of updating the comment for thegendev_attr_groupsdeclaration to match the code change
* in that spirit also adapted the vector size of that field
* eliminated the now unnecessary second loop counter 'j'
Quoted 4 lines
drivers/scsi/scsi_sysfs.c | 11 +---------- include/scsi/scsi_device.h | 6 ------ 2 files changed, 1 insertion(+), 16 deletions(-)
Looks good to me.
Signature · 4 lines
Best Regards, Benjamin Block / Linux on IBM Z Kernel Development / IBM Systems IBM Deutschland Research & Development GmbH / https://www.ibm.com/privacy Vorsitz. AufsR.: Gregor Pillen / Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294
Re: Missing driver-specific sysfs attributes of scsi_device [was: Re: [PATCH v4 00/46] Register SCSI sysfs attributes earlier]
In reply to Steffen MaierQuoted 21 lines · Steffen Maier
Hi Bart, hi Martin,
since Friday 2021-10-22 our CI reports errors with linux-next. It complains about missing zfcp-lun resources (although that's a follow-on error). Machines that have their root-fs on zfcp-attached SCSI disk(s) are stuck in boot. Looking at user visible effects, I see zfcp-specific sysfs attributes of
scsi_devicemissing:$ lszfcp -D /usr/sbin/lszfcp: line 390: /sys/bus/ccw/drivers/zfcp/0.0.1780/host0/rport-0:0-0/target0:0:0/0:0:0:1089224725//hba_id: No such file or directory /usr/sbin/lszfcp: line 391: /sys/bus/ccw/drivers/zfcp/0.0.1780/host0/rport-0:0-0/target0:0:0/0:0:0:1089224725//wwpn: No such file or directory /usr/sbin/lszfcp: line 392: /sys/bus/ccw/drivers/zfcp/0.0.1780/host0/rport-0:0-0/target0:0:0/0:0:0:1089224725//fcp_lun: No such file or directoryThat made me think of this patch series. It also happened so that Martin applied the series to 5.16/scsi-queue on 2021-10-21. Linux-next merged it on 2021-10-22:
Merging scsi-mkp/for-next (
83c3a7beaef7scsi: lpfc: Update lpfc version to 14.0.0.3)$ git merge -m Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git scsi-mkp/for-next ... + drivers/s390/scsi/zfcp_ext.h | 4 +- + drivers/s390/scsi/zfcp_fsf.c | 2 +- + drivers/s390/scsi/zfcp_scsi.c | 8 +- + drivers/s390/scsi/zfcp_sysfs.c | 52 ++-- [https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20211022&id=cf6c9d12750cf6f3f6aeffcd0bdb36b1ac993f44]
Quoted 7 lines
So this seems to match with the occurrence of problems for us.
I wonder if any of the other LLDDs see similar problems. I left those LLDD patches in the list below, that also were migrated from
sdev_attrstosdev_groups.Guess it would be good to fix this before the v5.16 merge window opens (2021-11-08 after predicted v5.15 release? [http://phb-crystal-ball.org/]) so the error does not land in Linus' tree (which our CI also tests).
Not sure if I'll find time to dig deeper.
Didn't know about regzbot, so I'm trying to feed it after the facts.
#regzbot ^introduced: 92c4b58b15c56298b1b225c1d2e533165b3e32af
#regzbot fixed-by: 3a71f0f7a51259b3cb95d79cac1e19dcc5e89ce9
#regzbot monitor: https://lore.kernel.org/r/[email protected]
#regzbot link: https://lore.kernel.org/r/d9405d786496756564b31540cc73a9d22cc97730.camel@HansenPartnership.com
#regzbot monitor: https://lore.kernel.org/r/[email protected]
#regzbot monitor: https://lore.kernel.org/r/[email protected]
#regzbot activity-ignore
Quoted 59 lines · Martin K. Petersen
Quoted 55 lines · Bart Van Assche
Quoted 10 lines
For certain user space software, e.g. udev, it is important that sysfs attributes are registered before the
KOBJ_ADDuevent is emitted. Hence this patch series that removes thedevice_create_file()andsysfs_create_groups()calls from the SCSI core. Please consider this patch series for kernel v5.16.Thanks,
[...]
Applied to 5.16/scsi-queue, thanks!
[01/46] scsi: core: Register sysfs attributes earlier
https://git.kernel.org/mkp/scsi/c/92c4b58b15c5
[02/46] ata: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/c3f69c7f629f
[03/46] firewire: sbp2: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/5e88e67b6f3b[06/46] scsi: zfcp: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/d8d7cf3f7d07[10/46] scsi: 53c700: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/90cb6538b5da
[11/46] scsi: aacraid: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/bd16d71185c8[18/46] scsi: cxlflash: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/780c678912fb[21/46] scsi: hpsa: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/4cd16323b523[25/46] scsi: ipr: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/47d1e6ae0e1e[28/46] scsi: megaraid: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/09723bb252ca
[29/46] scsi: mpt3sas: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/1bb3ca27d2ca[31/46] scsi: myrb: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/582c0360db90
[32/46] scsi: myrs: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/087c3ace6337[42/46] scsi: smartpqi: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/64fc9015fbeb[45/46] scsi: usb: Switch to attribute groups
https://git.kernel.org/mkp/scsi/c/01e570febaaa
[46/46] scsi: core: Remove two host template members that are no longer used
https://git.kernel.org/mkp/scsi/c/a47c6b713e89
Signature · 11 lines
Mit freundlichen Gruessen / Kind regards Steffen Maier Linux on IBM Z and LinuxONE https://www.ibm.com/privacy/us/en/ IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Gregor Pillen Geschaeftsfuehrung: Dirk Wittkopp Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
Re: Missing driver-specific sysfs attributes of scsi_device [was: Re: [PATCH v4 00/46] Register SCSI sysfs attributes earlier]
Quoted 20 lines · Steffen Maier
Quoted 5 lines · Steffen Maier
since Friday 2021-10-22 our CI reports errors with linux-next. It complains about missing zfcp-lun resources (although that's a follow-on error). Machines that have their root-fs on zfcp-attached SCSI disk(s) are stuck in boot. Looking at user visible effects, I see zfcp-specific sysfs attributes of
scsi_devicemissing:[...]
Quoted 1 line
Not sure if I'll find time to dig deeper.
Didn't know about regzbot, so I'm trying to feed it after the facts.
#regzbot ^introduced:
92c4b58b15c56298b1b225c1d2e533165b3e32af#regzbot fixed-by:3a71f0f7a51259b3cb95d79cac1e19dcc5e89ce9#regzbot monitor:
https://lore.kernel.org/r/[email protected]#regzbot link:
https://lore.kernel.org/r/d9405d786496756564b31540cc73a9d22cc97730.camel@HansenPartnership.com
Quoted 7 lines
#regzbot monitor:
https://lore.kernel.org/r/[email protected]#regzbot monitor:
https://lore.kernel.org/r/[email protected]#regzbot activity-ignore
Hah, thx for getting regzbot involved, it afaics handled all those commands as it was supposed to.
But FWIW: at least for now regzbot is there to make sure that regressions don't fall through the cracks. Maybe that changes one day. But until then there is no need to tell regzbot about regressions already fixed.
Ciao, Thorsten