libsas: Some tidy-up
Subsystems (5)
John Garry
reviewercover libsas: Some tidy-up
This series tidies-up libsas a bit, including:
- delete structure(s) with only one member
- delete structure members which are only ever set
- delete structure members which are never set and code which relies on that member being set
This conflicts with the following series:
https://lore.kernel.org/linux-scsi/[email protected]/
Any conflict should be trivial to resolve.
Based on mkp-scsi staging at a18e81d17a7e ("scsi: ufs: ufs-pci: Add support for QEMU")
This series is compile tested only.
John Garry (10):
scsi: libsas: Delete sas_ha_struct.lldd_module
scsi: libsas: Delete enum sas_class
scsi: libsas: Delete enum sas_phy_type
scsi: libsas: Delete struct scsi_core
scsi: libsas: Delete sas_ssp_task.retry_count
scsi: libsas: Delete sas_ssp_task.enable_first_burst
scsi: libsas: Delete sas_ssp_task.task_prio
scsi: libsas: Delete sas_ata_task.set_affil_pol
scsi: libsas: Delete sas_ata_task.stp_affil_pol
scsi: libsas: Delete sas_ata_task.retry_count
drivers/scsi/aic94xx/aic94xx_hwi.c | 4 +--- drivers/scsi/aic94xx/aic94xx_init.c | 7 +++---- drivers/scsi/aic94xx/aic94xx_task.c | 12 ++--------- drivers/scsi/hisi_sas/hisi_sas_main.c | 9 +++----- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 9 ++------ drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 3 +-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 9 ++++---- drivers/scsi/isci/host.h | 2 +- drivers/scsi/isci/init.c | 5 ++--- drivers/scsi/isci/phy.c | 2 -- drivers/scsi/isci/request.c | 1 - drivers/scsi/libsas/sas_ata.c | 9 ++++---- drivers/scsi/libsas/sas_discover.c | 8 +++---- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/libsas/sas_host_smp.c | 4 ++-- drivers/scsi/libsas/sas_init.c | 16 +++++++------- drivers/scsi/libsas/sas_internal.h | 1 - drivers/scsi/libsas/sas_phy.c | 8 +++---- drivers/scsi/libsas/sas_port.c | 8 +++---- drivers/scsi/libsas/sas_scsi_host.c | 15 +++++++------ drivers/scsi/mvsas/mv_init.c | 7 ++----- drivers/scsi/mvsas/mv_sas.c | 9 ++------ drivers/scsi/pm8001/pm8001_hwi.c | 3 --- drivers/scsi/pm8001/pm8001_init.c | 5 +---- drivers/scsi/pm8001/pm80xx_hwi.c | 3 --- include/scsi/libsas.h | 29 +------------------------- 26 files changed, 58 insertions(+), 132 deletions(-)
Signature · 1 line
2.35.3
John Garry
reviewerPATCH 1/10 scsi: libsas: Delete sas_ha_struct.lldd_module
Since libsas was introduced in commit 2908d778ab3e ("[SCSI] aic94xx: new driver"), sas_ha_struct.lldd_module has only ever been set, so remove it.
Struct scsi_host_template already has a reference to the LLD driver module as to stop the driver being removed unexpectedly.
--- drivers/scsi/aic94xx/aic94xx_init.c | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 - drivers/scsi/isci/init.c | 1 - drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - include/scsi/libsas.h | 1 - 7 files changed, 7 deletions(-)
drivers/scsi/aic94xx/aic94xx_init.c +0 -1
@@ -667,7 +667,6 @@ static int asd_register_sas_ha(struct asd_ha_struct *asd_ha) } asd_ha->sas_ha.sas_ha_name = (char *) asd_ha->name; - asd_ha->sas_ha.lldd_module =THIS_MODULE ; asd_ha->sas_ha.sas_addr = &asd_ha->hw_prof.sas_addr[0 ];for (i =0 ; i <ASD_MAX_PHYS ; i++) {
drivers/scsi/hisi_sas/hisi_sas_main.c +0 -1
@@ -2514,7 +2514,6 @@ int hisi_sas_probe(struct platform_device *pdev, sha->sas_ha_name =DRV_NAME ; sha->dev = hisi_hba->dev; - sha->lldd_module =THIS_MODULE ; sha->sas_addr = &hisi_hba->sas_addr[0 ]; sha->num_phys = hisi_hba->n_phy; sha->core.shost = hisi_hba->shost;
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +0 -1
@@ -4973,7 +4973,6 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) sha->sas_ha_name =DRV_NAME ; sha->dev = dev; - sha->lldd_module =THIS_MODULE ; sha->sas_addr = &hisi_hba->sas_addr[0 ]; sha->num_phys = hisi_hba->n_phy;
drivers/scsi/isci/init.c +0 -1
@@ -250,7 +250,6 @@ static int isci_register_sas_ha(struct isci_host *isci_host)return -ENOMEM ; sas_ha->sas_ha_name =DRV_NAME ; - sas_ha->lldd_module =THIS_MODULE ; sas_ha->sas_addr = &isci_host->phys[0 ].sas_addr[0 ];for (i =0 ; i <SCI_MAX_PHYS ; i++) {
drivers/scsi/mvsas/mv_init.c +0 -1
@@ -458,7 +458,6 @@ static void mvs_post_sas_ha_init(struct Scsi_Host *shost, sha->sas_ha_name =DRV_NAME ; sha->dev = mvi->dev; - sha->lldd_module =THIS_MODULE ; sha->sas_addr = &mvi->sas_addr[0 ]; sha->num_phys = nr_core * chip_info->n_phy;
drivers/scsi/pm8001/pm8001_init.c +0 -1
@@ -654,7 +654,6 @@ static void pm8001_post_sas_ha_init(struct Scsi_Host *shost, sha->sas_ha_name =DRV_NAME ; sha->dev = pm8001_ha->dev; sha->strict_wide_ports =1 ; - sha->lldd_module =THIS_MODULE ; sha->sas_addr = &pm8001_ha->sas_addr[0 ]; sha->num_phys = chip_info->n_phy; sha->core.shost = shost;
include/scsi/libsas.h +0 -1
@@ -376,7 +376,6 @@ struct sas_ha_struct {/* public: */ char *sas_ha_name;struct device *dev;/* should be set */ -struct module *lldd_module;/* should be set */ struct workqueue_struct *event_q;struct workqueue_struct *disco_q;
Signature · 1 line
2.35.3
Re: [PATCH 01/10] scsi: libsas: Delete sas_ha_struct.lldd_module
Quoted 7 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ha_struct.lldd_module has only ever been set, so remove it.Struct
scsi_host_templatealready has a reference to the LLD driver module as to stop the driver being removed unexpectedly.Signed-off-by John Garry <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 01/10] scsi: libsas: Delete sas_ha_struct.lldd_module
In reply to John GarryQuoted 7 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ha_struct.lldd_module has only ever been set, so remove it.Struct
scsi_host_templatealready has a reference to the LLD driver module as to stop the driver being removed unexpectedly.Signed-off-by John Garry<[email protected]>
Quoted 9 lines
--- drivers/scsi/aic94xx/aic94xx_init.c | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 - drivers/scsi/isci/init.c | 1 - drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - include/scsi/libsas.h | 1 - 7 files changed, 7 deletions(-)
Re: [PATCH 01/10] scsi: libsas: Delete sas_ha_struct.lldd_module
In reply to John GarryQuoted 7 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ha_struct.lldd_module has only ever been set, so remove it.Struct
scsi_host_templatealready has a reference to the LLD driver module as to stop the driver being removed unexpectedly.Signed-off-by John Garry <[email protected]>
Quoted 10 lines
--- drivers/scsi/aic94xx/aic94xx_init.c | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 - drivers/scsi/isci/init.c | 1 - drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - include/scsi/libsas.h | 1 - 7 files changed, 7 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
John Garry
reviewerPATCH 2/10 scsi: libsas: Delete enum sas_class
In reply to John Garryenum sas_class prob would have been useful if function sas_show_class() was ever implemented, which it wasn't.
enum sas_class is used as asd_sas_port.class and asd_sas_phy.class, which are only ever set, so delete these members and the enum.
--- drivers/scsi/aic94xx/aic94xx_hwi.c | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - drivers/scsi/isci/phy.c | 1 - drivers/scsi/libsas/sas_internal.h | 1 - drivers/scsi/libsas/sas_port.c | 2 -- drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - include/scsi/libsas.h | 7 ------- 8 files changed, 15 deletions(-)
drivers/scsi/aic94xx/aic94xx_hwi.c +0 -1
@@ -72,7 +72,6 @@ static int asd_init_phy(struct asd_phy *phy)struct asd_sas_phy *sas_phy = &phy->sas_phy; sas_phy->enabled =1 ; - sas_phy->class =SAS ; sas_phy->iproto =SAS_PROTOCOL_ALL ; sas_phy->tproto =0 ; sas_phy->type =PHY_TYPE_PHYSICAL ;
drivers/scsi/hisi_sas/hisi_sas_main.c +0 -1
@@ -1018,7 +1018,6 @@ static void hisi_sas_phy_init(struct hisi_hba *hisi_hba, int phy_no) phy->minimum_linkrate =SAS_LINK_RATE_1_5_GBPS ; phy->maximum_linkrate = hisi_hba->hw->phy_get_max_linkrate (); sas_phy->enabled = (phy_no < hisi_hba->n_phy) ?1 :0 ; - sas_phy->class =SAS ; sas_phy->iproto =SAS_PROTOCOL_ALL ; sas_phy->tproto =0 ; sas_phy->type =PHY_TYPE_PHYSICAL ;
drivers/scsi/isci/phy.c +0 -1
@@ -1404,7 +1404,6 @@ void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index) iphy->sas_phy.ha = &ihost->sas_ha; iphy->sas_phy.lldd_phy = iphy; iphy->sas_phy.enabled =1 ; - iphy->sas_phy.class =SAS ; iphy->sas_phy.iproto =SAS_PROTOCOL_ALL ; iphy->sas_phy.tproto =0 ; iphy->sas_phy.type =PHY_TYPE_PHYSICAL ;
drivers/scsi/libsas/sas_internal.h +0 -1
@@ -41,7 +41,6 @@ struct sas_phy_data {void sas_scsi_recover_host (struct Scsi_Host *shost); -int sas_show_class (enum sas_class class,char *buf);int sas_show_proto (enum sas_protocol proto,char *buf);int sas_show_linkrate (enum sas_linkrate linkrate,char *buf);int sas_show_oob_mode (enum sas_oob_mode oob_mode,char *buf);
drivers/scsi/libsas/sas_port.c +0 -2
@@ -83,7 +83,6 @@ static void sas_form_port_add_phy(struct asd_sas_port *port,memcpy (port->sas_addr, phy->sas_addr,SAS_ADDR_SIZE );if (*(u64 *)port->attached_sas_addr ==0 ) { - port->class = phy->class;memcpy (port->attached_sas_addr, phy->attached_sas_addr,SAS_ADDR_SIZE ); port->iproto = phy->iproto;
@@ -249,7 +248,6 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone)INIT_LIST_HEAD (&port->phy_list);memset (port->sas_addr,0 ,SAS_ADDR_SIZE );memset (port->attached_sas_addr,0 ,SAS_ADDR_SIZE ); - port->class =0 ; port->iproto =0 ; port->tproto =0 ; port->oob_mode =0 ;
drivers/scsi/mvsas/mv_init.c +0 -1
@@ -84,7 +84,6 @@ static void mvs_phy_init(struct mvs_info *mvi, int phy_id) phy->port =NULL ;timer_setup (&phy->timer,NULL ,0 ); sas_phy->enabled = (phy_id < mvi->chip->n_phy) ?1 :0 ; - sas_phy->class =SAS ; sas_phy->iproto =SAS_PROTOCOL_ALL ; sas_phy->tproto =0 ; sas_phy->type =PHY_TYPE_PHYSICAL ;
drivers/scsi/pm8001/pm8001_init.c +0 -1
@@ -162,7 +162,6 @@ static void pm8001_phy_init(struct pm8001_hba_info *pm8001_ha, int phy_id) phy->minimum_linkrate =SAS_LINK_RATE_1_5_GBPS ; phy->maximum_linkrate =SAS_LINK_RATE_6_0_GBPS ; sas_phy->enabled = (phy_id < pm8001_ha->chip->n_phy) ?1 :0 ; - sas_phy->class =SAS ; sas_phy->iproto =SAS_PROTOCOL_ALL ; sas_phy->tproto =0 ; sas_phy->type =PHY_TYPE_PHYSICAL ;
include/scsi/libsas.h +0 -7
@@ -23,11 +23,6 @@struct block_device ; -enum sas_class { -SAS , -EXPANDER -}; -enum sas_phy_role {PHY_ROLE_NONE =0 ,PHY_ROLE_TARGET =0x40 ,
@@ -258,7 +253,6 @@ struct asd_sas_port {/* public: */ int id; -enum sas_class class;u8 sas_addr[SAS_ADDR_SIZE ];u8 attached_sas_addr[SAS_ADDR_SIZE ];enum sas_protocol iproto;
@@ -319,7 +313,6 @@ struct asd_sas_phy {int enabled;/* must be set */ int id;/* must be set */ -enum sas_class class;enum sas_protocol iproto;enum sas_protocol tproto;
Signature · 1 line
2.35.3
Re: [PATCH 02/10] scsi: libsas: Delete enum sas_class
Quoted 7 lines · John Garry
enum
sas_classprob would have been useful if functionsas_show_class()was ever implemented, which it wasn't.enum
sas_classis used as asd_sas_port.class and asd_sas_phy.class, which are only ever set, so delete these members and the enum.Signed-off-by John Garry <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 02/10] scsi: libsas: Delete enum sas_class
In reply to John GarryQuoted 7 lines · John Garry
enum
sas_classprob would have been useful if functionsas_show_class()was ever implemented, which it wasn't.enum
sas_classis used as asd_sas_port.class and asd_sas_phy.class, which are only ever set, so delete these members and the enum.Signed-off-by John Garry<[email protected]>
Quoted 10 lines
--- drivers/scsi/aic94xx/aic94xx_hwi.c | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - drivers/scsi/isci/phy.c | 1 - drivers/scsi/libsas/sas_internal.h | 1 - drivers/scsi/libsas/sas_port.c | 2 -- drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - include/scsi/libsas.h | 7 ------- 8 files changed, 15 deletions(-)
Re: [PATCH 02/10] scsi: libsas: Delete enum sas_class
In reply to John GarryQuoted 7 lines · John Garry
enum
sas_classprob would have been useful if functionsas_show_class()was ever implemented, which it wasn't.enum
sas_classis used as asd_sas_port.class and asd_sas_phy.class, which are only ever set, so delete these members and the enum.Signed-off-by John Garry <[email protected]>
Quoted 11 lines
--- drivers/scsi/aic94xx/aic94xx_hwi.c | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - drivers/scsi/isci/phy.c | 1 - drivers/scsi/libsas/sas_internal.h | 1 - drivers/scsi/libsas/sas_port.c | 2 -- drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - include/scsi/libsas.h | 7 ------- 8 files changed, 15 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
John Garry
reviewerPATCH 3/10 scsi: libsas: Delete enum sas_phy_type
In reply to John Garryenum sas_phy_type is used for asd_sas_phy.type, which is only ever set, so delete this member and the enum.
--- drivers/scsi/aic94xx/aic94xx_hwi.c | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - drivers/scsi/isci/phy.c | 1 - drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - include/scsi/libsas.h | 6 ------ 6 files changed, 11 deletions(-)
drivers/scsi/aic94xx/aic94xx_hwi.c +0 -1
@@ -74,7 +74,6 @@ static int asd_init_phy(struct asd_phy *phy) sas_phy->enabled =1 ; sas_phy->iproto =SAS_PROTOCOL_ALL ; sas_phy->tproto =0 ; - sas_phy->type =PHY_TYPE_PHYSICAL ; sas_phy->role =PHY_ROLE_INITIATOR ; sas_phy->oob_mode =OOB_NOT_CONNECTED ; sas_phy->linkrate =SAS_LINK_RATE_UNKNOWN ;
drivers/scsi/hisi_sas/hisi_sas_main.c +0 -1
@@ -1020,7 +1020,6 @@ static void hisi_sas_phy_init(struct hisi_hba *hisi_hba, int phy_no) sas_phy->enabled = (phy_no < hisi_hba->n_phy) ?1 :0 ; sas_phy->iproto =SAS_PROTOCOL_ALL ; sas_phy->tproto =0 ; - sas_phy->type =PHY_TYPE_PHYSICAL ; sas_phy->role =PHY_ROLE_INITIATOR ; sas_phy->oob_mode =OOB_NOT_CONNECTED ; sas_phy->linkrate =SAS_LINK_RATE_UNKNOWN ;
drivers/scsi/isci/phy.c +0 -1
@@ -1406,7 +1406,6 @@ void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index) iphy->sas_phy.enabled =1 ; iphy->sas_phy.iproto =SAS_PROTOCOL_ALL ; iphy->sas_phy.tproto =0 ; - iphy->sas_phy.type =PHY_TYPE_PHYSICAL ; iphy->sas_phy.role =PHY_ROLE_INITIATOR ; iphy->sas_phy.oob_mode =OOB_NOT_CONNECTED ; iphy->sas_phy.linkrate =SAS_LINK_RATE_UNKNOWN ;
drivers/scsi/mvsas/mv_init.c +0 -1
@@ -86,7 +86,6 @@ static void mvs_phy_init(struct mvs_info *mvi, int phy_id) sas_phy->enabled = (phy_id < mvi->chip->n_phy) ?1 :0 ; sas_phy->iproto =SAS_PROTOCOL_ALL ; sas_phy->tproto =0 ; - sas_phy->type =PHY_TYPE_PHYSICAL ; sas_phy->role =PHY_ROLE_INITIATOR ; sas_phy->oob_mode =OOB_NOT_CONNECTED ; sas_phy->linkrate =SAS_LINK_RATE_UNKNOWN ;
drivers/scsi/pm8001/pm8001_init.c +0 -1
@@ -164,7 +164,6 @@ static void pm8001_phy_init(struct pm8001_hba_info *pm8001_ha, int phy_id) sas_phy->enabled = (phy_id < pm8001_ha->chip->n_phy) ?1 :0 ; sas_phy->iproto =SAS_PROTOCOL_ALL ; sas_phy->tproto =0 ; - sas_phy->type =PHY_TYPE_PHYSICAL ; sas_phy->role =PHY_ROLE_INITIATOR ; sas_phy->oob_mode =OOB_NOT_CONNECTED ; sas_phy->linkrate =SAS_LINK_RATE_UNKNOWN ;
include/scsi/libsas.h +0 -6
@@ -29,11 +29,6 @@ enum sas_phy_role { PHY_ROLE_INITIATOR = 0x80, }; -enum sas_phy_type { -PHY_TYPE_PHYSICAL , -PHY_TYPE_VIRTUAL -}; -/* The events are mnemonically described in sas_dump.c * so when updating/adding events here, please also * update the other file too.
@@ -316,7 +311,6 @@ struct asd_sas_phy {enum sas_protocol iproto;enum sas_protocol tproto; -enum sas_phy_type type;enum sas_phy_role role;enum sas_oob_mode oob_mode;enum sas_linkrate linkrate;
Signature · 1 line
2.35.3
Re: [PATCH 03/10] scsi: libsas: Delete enum sas_phy_type
Quoted 4 lines · John Garry
enum
sas_phy_typeis used for asd_sas_phy.type, which is only ever set, so delete this member and the enum.Signed-off-by John Garry <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 03/10] scsi: libsas: Delete enum sas_phy_type
In reply to John GarryQuoted 4 lines · John Garry
enum
sas_phy_typeis used for asd_sas_phy.type, which is only ever set, so delete this member and the enum.Signed-off-by John Garry<[email protected]>
Quoted 8 lines
--- drivers/scsi/aic94xx/aic94xx_hwi.c | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - drivers/scsi/isci/phy.c | 1 - drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - include/scsi/libsas.h | 6 ------ 6 files changed, 11 deletions(-)
Re: [PATCH 03/10] scsi: libsas: Delete enum sas_phy_type
In reply to John GarryQuoted 4 lines · John Garry
enum
sas_phy_typeis used for asd_sas_phy.type, which is only ever set, so delete this member and the enum.Signed-off-by John Garry <[email protected]>
Quoted 9 lines
--- drivers/scsi/aic94xx/aic94xx_hwi.c | 1 - drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - drivers/scsi/isci/phy.c | 1 - drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/pm8001/pm8001_init.c | 1 - include/scsi/libsas.h | 6 ------ 6 files changed, 11 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
John Garry
reviewerPATCH 4/10 scsi: libsas: Delete struct scsi_core
In reply to John GarrySince commit 79855d178557 ("libsas: remove task_collector mode"), struct scsi_core only contains a reference to the shost. struct scsi_core is only used in sas_ha_struct.core, so delete scsi_core and replace with a reference to the shost there.
--- drivers/scsi/aic94xx/aic94xx_hwi.c | 2 +- drivers/scsi/aic94xx/aic94xx_init.c | 6 +++--- drivers/scsi/hisi_sas/hisi_sas_main.c | 6 +++--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 6 +++--- drivers/scsi/isci/host.h | 2 +- drivers/scsi/isci/init.c | 4 ++-- drivers/scsi/libsas/sas_ata.c | 8 ++++---- drivers/scsi/libsas/sas_discover.c | 8 ++++---- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/libsas/sas_host_smp.c | 4 ++-- drivers/scsi/libsas/sas_init.c | 16 ++++++++-------- drivers/scsi/libsas/sas_phy.c | 8 ++++---- drivers/scsi/libsas/sas_port.c | 6 +++--- drivers/scsi/libsas/sas_scsi_host.c | 14 +++++++------- drivers/scsi/mvsas/mv_init.c | 4 ++-- drivers/scsi/pm8001/pm8001_init.c | 2 +- include/scsi/libsas.h | 7 +------ 17 files changed, 50 insertions(+), 55 deletions(-)
drivers/scsi/aic94xx/aic94xx_hwi.c +1 -1
@@ -28,7 +28,7 @@ static int asd_get_user_sas_addr(struct asd_ha_struct *asd_ha)if (asd_ha->hw_prof.sas_addr[0 ])return 0 ; -return sas_request_addr (asd_ha->sas_ha.core.shost, +return sas_request_addr (asd_ha->sas_ha.shost, asd_ha->hw_prof.sas_addr); }
drivers/scsi/aic94xx/aic94xx_init.c +3 -3
@@ -687,8 +687,8 @@ static int asd_unregister_sas_ha(struct asd_ha_struct *asd_ha) err =sas_unregister_ha (&asd_ha->sas_ha); -sas_remove_host (asd_ha->sas_ha.core.shost); -scsi_host_put (asd_ha->sas_ha.core.shost); +sas_remove_host (asd_ha->sas_ha.shost); +scsi_host_put (asd_ha->sas_ha.shost);kfree (asd_ha->sas_ha.sas_phy);kfree (asd_ha->sas_ha.sas_port);
@@ -738,7 +738,7 @@ static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)asd_printk ("found %s, device %s\n" , asd_ha->name,pci_name (dev));SHOST_TO_SAS_HA (shost) = &asd_ha->sas_ha; - asd_ha->sas_ha.core.shost = shost; + asd_ha->sas_ha.shost = shost; shost->transportt = aic94xx_transport_template; shost->max_id = ~0 ; shost->max_lun = ~0 ;
drivers/scsi/hisi_sas/hisi_sas_main.c +3 -3
@@ -2514,7 +2514,7 @@ int hisi_sas_probe(struct platform_device *pdev, sha->dev = hisi_hba->dev; sha->sas_addr = &hisi_hba->sas_addr[0 ]; sha->num_phys = hisi_hba->n_phy; - sha->core.shost = hisi_hba->shost; + sha->shost = hisi_hba->shost;for (i =0 ; i < hisi_hba->n_phy; i++) { sha->sas_phy[i] = &hisi_hba->phy[i].sas_phy;
@@ -2556,12 +2556,12 @@ void hisi_sas_remove(struct platform_device *pdev) {struct sas_ha_struct *sha =platform_get_drvdata (pdev);struct hisi_hba *hisi_hba = sha->lldd_ha; -struct Scsi_Host *shost = sha->core.shost; +struct Scsi_Host *shost = sha->shost;del_timer_sync (&hisi_hba->timer);sas_unregister_ha (sha); -sas_remove_host (sha->core.shost); +sas_remove_host (shost);hisi_sas_free (hisi_hba);scsi_host_put (shost);
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +3 -3
@@ -4956,7 +4956,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) sha->sas_phy = arr_phy; sha->sas_port = arr_port; - sha->core.shost = shost; + sha->shost = shost; sha->lldd_ha = hisi_hba; shost->transportt = hisi_sas_stt;
@@ -5060,14 +5060,14 @@ static void hisi_sas_v3_remove(struct pci_dev *pdev)struct device *dev = &pdev->dev;struct sas_ha_struct *sha =dev_get_drvdata (dev);struct hisi_hba *hisi_hba = sha->lldd_ha; -struct Scsi_Host *shost = sha->core.shost; +struct Scsi_Host *shost = sha->shost;pm_runtime_get_noresume (dev);del_timer_sync (&hisi_hba->timer);sas_unregister_ha (sha);flush_workqueue (hisi_hba->wq); -sas_remove_host (sha->core.shost); +sas_remove_host (shost);hisi_sas_v3_destroy_irqs (pdev, hisi_hba);hisi_sas_free (hisi_hba);
drivers/scsi/isci/host.h +1 -1
@@ -306,7 +306,7 @@ static inline struct isci_pci_info *to_pci_info(struct pci_dev *pdev)static inline struct Scsi_Host *to_shost (struct isci_host *ihost) { -return ihost->sas_ha.core.shost; +return ihost->sas_ha.shost; }#define for_each_isci_host (id, ihost, pdev) \
drivers/scsi/isci/init.c +2 -2
@@ -574,7 +574,7 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id) goto err_shost;SHOST_TO_SAS_HA (shost) = &ihost->sas_ha; - ihost->sas_ha.core.shost = shost; + ihost->sas_ha.shost = shost; shost->transportt = isci_transport_template; shost->max_id = ~0 ;
@@ -729,7 +729,7 @@ static int isci_resume(struct device *dev)sas_prep_resume_ha (&ihost->sas_ha);isci_host_init (ihost); -isci_host_start (ihost->sas_ha.core.shost); +isci_host_start (ihost->sas_ha.shost);wait_for_start (ihost);sas_resume_ha (&ihost->sas_ha);
drivers/scsi/libsas/sas_ata.c +4 -4
@@ -162,7 +162,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)struct ata_port *ap = qc->ap;struct domain_device *dev = ap->private_data;struct sas_ha_struct *sas_ha = dev->port->ha; -struct Scsi_Host *host = sas_ha->core.shost; +struct Scsi_Host *host = sas_ha->shost;struct sas_internal *i =to_sas_internal (host->transportt);/* TODO: we should try to remove that unlock */
@@ -235,7 +235,7 @@ static void sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc)static struct sas_internal *dev_to_sas_internal (struct domain_device *dev) { -return to_sas_internal (dev->port->ha->core.shost->transportt); +return to_sas_internal (dev->port->ha->shost->transportt); }static int sas_get_ata_command_set (struct domain_device *dev)
@@ -584,7 +584,7 @@ static struct ata_port_info sata_port_info = {int sas_ata_init (struct domain_device *found_dev) {struct sas_ha_struct *ha = found_dev->port->ha; -struct Scsi_Host *shost = ha->core.shost; +struct Scsi_Host *shost = ha->shost;struct ata_host *ata_host;struct ata_port *ap;int rc;
@@ -822,7 +822,7 @@ static void async_sas_ata_eh(void *data, async_cookie_t cookie)struct sas_ha_struct *ha = dev->port->ha;sas_ata_printk (KERN_DEBUG , dev,"dev error handler\n" ); -ata_scsi_port_error_handler (ha->core.shost, ap); +ata_scsi_port_error_handler (ha->shost, ap);sas_put_device (dev); }
drivers/scsi/libsas/sas_discover.c +4 -4
@@ -170,7 +170,7 @@ int sas_notify_lldd_dev_found(struct domain_device *dev) {int res =0 ;struct sas_ha_struct *sas_ha = dev->port->ha; -struct Scsi_Host *shost = sas_ha->core.shost; +struct Scsi_Host *shost = sas_ha->shost;struct sas_internal *i =to_sas_internal (shost->transportt);if (!i->dft->lldd_dev_found)
@@ -192,7 +192,7 @@ int sas_notify_lldd_dev_found(struct domain_device *dev)void sas_notify_lldd_dev_gone (struct domain_device *dev) {struct sas_ha_struct *sas_ha = dev->port->ha; -struct Scsi_Host *shost = sas_ha->core.shost; +struct Scsi_Host *shost = sas_ha->shost;struct sas_internal *i =to_sas_internal (shost->transportt);if (!i->dft->lldd_dev_gone)
@@ -234,7 +234,7 @@ static void sas_suspend_devices(struct work_struct *work)struct domain_device *dev;struct sas_discovery_event *ev =to_sas_discovery_event (work);struct asd_sas_port *port = ev->port; -struct Scsi_Host *shost = port->ha->core.shost; +struct Scsi_Host *shost = port->ha->shost;struct sas_internal *si =to_sas_internal (shost->transportt);clear_bit (DISCE_SUSPEND , &port->disc.pending);
@@ -373,7 +373,7 @@ static bool sas_abort_cmd(struct request *req, void *data)static void sas_abort_device_scsi_cmds (struct domain_device *dev) {struct sas_ha_struct *sas_ha = dev->port->ha; -struct Scsi_Host *shost = sas_ha->core.shost; +struct Scsi_Host *shost = sas_ha->shost;if (dev_is_expander (dev->dev_type))return ;
drivers/scsi/libsas/sas_expander.c +1 -1
@@ -37,7 +37,7 @@ static int smp_execute_task_sg(struct domain_device *dev,int res, retry;struct sas_task *task =NULL ;struct sas_internal *i = -to_sas_internal (dev->port->ha->core.shost->transportt); +to_sas_internal (dev->port->ha->shost->transportt);struct sas_ha_struct *ha = dev->port->ha;pm_runtime_get_sync (ha->dev);
drivers/scsi/libsas/sas_host_smp.c +2 -2
@@ -114,7 +114,7 @@ static int sas_host_smp_write_gpio(struct sas_ha_struct *sas_ha, u8 *resp_data, u8 reg_type, u8 reg_index, u8 reg_count, u8 *req_data) { - struct sas_internal *i = to_sas_internal(sas_ha->core.shost->transportt); + struct sas_internal *i = to_sas_internal(sas_ha->shost->transportt);int written;if (i->dft->lldd_write_gpio ==NULL ) {
@@ -182,7 +182,7 @@ static void sas_phy_control(struct sas_ha_struct *sas_ha, u8 phy_id, enum sas_linkrate max, u8 *resp_data) { struct sas_internal *i = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt);struct sas_phy_linkrates rates;struct asd_sas_phy *asd_phy;
drivers/scsi/libsas/sas_init.c +8 -8
@@ -183,7 +183,7 @@ static int sas_get_linkerrors(struct sas_phy *phy)struct sas_ha_struct *sas_ha =SHOST_TO_SAS_HA (shost);struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];struct sas_internal *i = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt);return i->dft->lldd_control_phy (asd_phy,PHY_FUNC_GET_EVENTS ,NULL ); }
@@ -232,7 +232,7 @@ static int transport_sas_phy_reset(struct sas_phy *phy, int hard_reset)struct sas_ha_struct *sas_ha =SHOST_TO_SAS_HA (shost);struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];struct sas_internal *i = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt);if (!hard_reset &&sas_try_ata_reset (asd_phy) ==0 )return 0 ;
@@ -266,7 +266,7 @@ int sas_phy_enable(struct sas_phy *phy, int enable)struct sas_ha_struct *sas_ha =SHOST_TO_SAS_HA (shost);struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];struct sas_internal *i = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt);if (enable) ret =transport_sas_phy_reset (phy,0 );
@@ -303,7 +303,7 @@ int sas_phy_reset(struct sas_phy *phy, int hard_reset)struct sas_ha_struct *sas_ha =SHOST_TO_SAS_HA (shost);struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];struct sas_internal *i = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt); ret = i->dft->lldd_control_phy (asd_phy, reset_type,NULL ); }else {
@@ -339,7 +339,7 @@ int sas_set_phy_speed(struct sas_phy *phy,struct sas_ha_struct *sas_ha =SHOST_TO_SAS_HA (shost);struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];struct sas_internal *i = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt); ret = i->dft->lldd_control_phy (asd_phy,PHY_FUNC_SET_LINK_RATE , rates);
@@ -438,7 +438,7 @@ static void _sas_resume_ha(struct sas_ha_struct *ha, bool drain)/* all phys are back up or timed out, turn on i/o so we can * flush out disks that did not return */ -scsi_unblock_requests (ha->core.shost); +scsi_unblock_requests (ha->shost);if (drain)sas_drain_work (ha);clear_bit (SAS_HA_RESUMING , &ha->state);
@@ -468,7 +468,7 @@ void sas_suspend_ha(struct sas_ha_struct *ha)int i;sas_disable_events (ha); -scsi_block_requests (ha->core.shost); +scsi_block_requests (ha->shost);for (i =0 ; i < ha->num_phys; i++) {struct asd_sas_port *port = ha->sas_port[i];
@@ -641,7 +641,7 @@ struct asd_sas_event *sas_alloc_event(struct asd_sas_phy *phy,struct asd_sas_event *event;struct sas_ha_struct *sas_ha = phy->ha;struct sas_internal *i = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt); event =kmem_cache_zalloc (sas_event_cache, gfp_flags);if (!event)
drivers/scsi/libsas/sas_phy.c +4 -4
@@ -38,7 +38,7 @@ static void sas_phye_oob_error(struct work_struct *work)struct sas_ha_struct *sas_ha = phy->ha;struct asd_sas_port *port = phy->port;struct sas_internal *i = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt);sas_deform_port (phy,1 );
@@ -66,7 +66,7 @@ static void sas_phye_spinup_hold(struct work_struct *work)struct asd_sas_phy *phy = ev->phy;struct sas_ha_struct *sas_ha = phy->ha;struct sas_internal *i = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt); phy->error =0 ; i->dft->lldd_control_phy (phy,PHY_FUNC_RELEASE_SPINUP_HOLD ,NULL );
@@ -95,7 +95,7 @@ static void sas_phye_shutdown(struct work_struct *work)struct asd_sas_phy *phy = ev->phy;struct sas_ha_struct *sas_ha = phy->ha;struct sas_internal *i = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt);if (phy->enabled) {int ret;
@@ -131,7 +131,7 @@ int sas_register_phys(struct sas_ha_struct *sas_ha)spin_lock_init (&phy->sas_prim_lock); phy->frame_rcvd_size =0 ; - phy->phy =sas_phy_alloc (&sas_ha->core.shost->shost_gendev, i); + phy->phy =sas_phy_alloc (&sas_ha->shost->shost_gendev, i);if (!phy->phy)return -ENOMEM ;
drivers/scsi/libsas/sas_port.c +3 -3
@@ -28,7 +28,7 @@ static void sas_resume_port(struct asd_sas_phy *phy)struct domain_device *dev, *n;struct asd_sas_port *port = phy->port;struct sas_ha_struct *sas_ha = phy->ha; -struct sas_internal *si =to_sas_internal (sas_ha->core.shost->transportt); +struct sas_internal *si =to_sas_internal (sas_ha->shost->transportt);if (si->dft->lldd_port_formed) si->dft->lldd_port_formed (phy);
@@ -108,7 +108,7 @@ static void sas_form_port(struct asd_sas_phy *phy)struct asd_sas_port *port = phy->port;struct domain_device *port_dev =NULL ;struct sas_internal *si = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt);unsigned long flags;if (port) {
@@ -211,7 +211,7 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone)struct sas_ha_struct *sas_ha = phy->ha;struct asd_sas_port *port = phy->port;struct sas_internal *si = -to_sas_internal (sas_ha->core.shost->transportt); +to_sas_internal (sas_ha->shost->transportt);struct domain_device *dev;unsigned long flags;
drivers/scsi/libsas/sas_scsi_host.c +7 -7
@@ -279,7 +279,7 @@ static enum task_disposition sas_scsi_find_task(struct sas_task *task)unsigned long flags;int i, res;struct sas_internal *si = -to_sas_internal (task->dev->port->ha->core.shost->transportt); +to_sas_internal (task->dev->port->ha->shost->transportt);for (i =0 ; i <5 ; i++) {pr_notice ("%s: aborting task 0x%p\n" , __func__, task);
@@ -327,7 +327,7 @@ static int sas_recover_lu(struct domain_device *dev, struct scsi_cmnd *cmd)int res =TMF_RESP_FUNC_FAILED ;struct scsi_lun lun;struct sas_internal *i = -to_sas_internal (dev->port->ha->core.shost->transportt); +to_sas_internal (dev->port->ha->shost->transportt);int_to_scsilun (cmd->device->lun, &lun);
@@ -355,7 +355,7 @@ static int sas_recover_I_T(struct domain_device *dev) {int res =TMF_RESP_FUNC_FAILED ;struct sas_internal *i = -to_sas_internal (dev->port->ha->core.shost->transportt); +to_sas_internal (dev->port->ha->shost->transportt);pr_notice ("I_T nexus reset for dev %016llx\n" ,SAS_ADDR (dev->sas_addr));
@@ -410,7 +410,7 @@ static void sas_wait_eh(struct domain_device *dev)spin_unlock_irq (&ha->lock);/* make sure SCSI EH is complete */ -if (scsi_host_in_recovery (ha->core.shost)) { +if (scsi_host_in_recovery (ha->shost)) {msleep (10 ); goto retry; }
@@ -440,7 +440,7 @@ static int sas_queue_reset(struct domain_device *dev, int reset_type,set_bit (SAS_DEV_EH_PENDING , &dev->state);set_bit (reset_type, &dev->state);int_to_scsilun (lun, &dev->ssp_dev.reset_lun); -scsi_schedule_eh (ha->core.shost); +scsi_schedule_eh (ha->shost); }spin_unlock_irq (&ha->lock);
@@ -925,7 +925,7 @@ static int sas_execute_internal_abort(struct domain_device *device, unsigned int qid, void *data) { struct sas_ha_struct *ha = device->port->ha; -struct sas_internal *i =to_sas_internal (ha->core.shost->transportt); +struct sas_internal *i =to_sas_internal (ha->shost->transportt);struct sas_task *task =NULL ;int res, retry;
@@ -1015,7 +1015,7 @@ int sas_execute_tmf(struct domain_device *device, void *parameter, {struct sas_task *task;struct sas_internal *i = -to_sas_internal (device->port->ha->core.shost->transportt); +to_sas_internal (device->port->ha->shost->transportt);int res, retry;for (retry =0 ; retry <TASK_RETRY ; retry++) {
drivers/scsi/mvsas/mv_init.c +2 -2
@@ -414,7 +414,7 @@ static int mvs_prep_sas_ha_init(struct Scsi_Host *shost, sha->sas_phy = arr_phy; sha->sas_port = arr_port; - sha->core.shost = shost; + sha->shost = shost; sha->lldd_ha =kzalloc (sizeof (struct mvs_prv_info ),GFP_KERNEL );if (!sha->lldd_ha)
@@ -470,7 +470,7 @@ static void mvs_post_sas_ha_init(struct Scsi_Host *shost, shost->sg_tablesize =min_t (u16,SG_ALL ,MVS_MAX_SG ); shost->can_queue = can_queue; mvi->shost->cmd_per_lun =MVS_QUEUE_SIZE ; - sha->core.shost = mvi->shost; + sha->shost = mvi->shost; }static void mvs_init_sas_add (struct mvs_info *mvi)
drivers/scsi/pm8001/pm8001_init.c +1 -1
@@ -654,7 +654,7 @@ static void pm8001_post_sas_ha_init(struct Scsi_Host *shost, sha->strict_wide_ports =1 ; sha->sas_addr = &pm8001_ha->sas_addr[0 ]; sha->num_phys = chip_info->n_phy; - sha->core.shost = shost; + sha->shost = shost; }/**
include/scsi/libsas.h +1 -6
@@ -333,11 +333,6 @@ struct asd_sas_phy {void *lldd_phy;/* not touched by the sas_class_code */ }; -struct scsi_core { -struct Scsi_Host *shost; - -}; -enum sas_ha_state {SAS_HA_REGISTERED ,SAS_HA_DRAINING ,
@@ -358,7 +353,7 @@ struct sas_ha_struct {struct mutex disco_mutex; -struct scsi_core core; +struct Scsi_Host *shost;/* public: */ char *sas_ha_name;
Signature · 1 line
2.35.3
Re: [PATCH 04/10] scsi: libsas: Delete struct scsi_core
Quoted 6 lines · John Garry
Since commit
79855d178557("libsas: removetask_collectormode"), structscsi_coreonly contains a reference to the shost. structscsi_coreis only used in sas_ha_struct.core, so deletescsi_coreand replace with a reference to the shost there.Signed-off-by John Garry <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 04/10] scsi: libsas: Delete struct scsi_core
In reply to John GarryQuoted 17 lines · John Garry
Since commit
79855d178557("libsas: removetask_collectormode"), structscsi_coreonly contains a reference to the shost. structscsi_coreis only used in sas_ha_struct.core, so deletescsi_coreand replace with a reference to the shost there.Signed-off-by John Garry<[email protected]>--- drivers/scsi/aic94xx/aic94xx_hwi.c | 2 +- drivers/scsi/aic94xx/aic94xx_init.c | 6 +++--- drivers/scsi/hisi_sas/hisi_sas_main.c | 6 +++--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 6 +++--- drivers/scsi/isci/host.h | 2 +- drivers/scsi/isci/init.c | 4 ++-- drivers/scsi/libsas/sas_ata.c | 8 ++++---- drivers/scsi/libsas/sas_discover.c | 8 ++++---- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/libsas/sas_host_smp.c | 4 ++--
Quoted 8 lines
drivers/scsi/libsas/sas_init.c | 16 ++++++++-------- drivers/scsi/libsas/sas_phy.c | 8 ++++---- drivers/scsi/libsas/sas_port.c | 6 +++--- drivers/scsi/libsas/sas_scsi_host.c | 14 +++++++------- drivers/scsi/mvsas/mv_init.c | 4 ++-- drivers/scsi/pm8001/pm8001_init.c | 2 +- include/scsi/libsas.h | 7 +------ 17 files changed, 50 insertions(+), 55 deletions(-)
Re: [PATCH 04/10] scsi: libsas: Delete struct scsi_core
In reply to John GarryQuoted 17 lines · John Garry
Since commit
79855d178557("libsas: removetask_collectormode"), structscsi_coreonly contains a reference to the shost. structscsi_coreis only used in sas_ha_struct.core, so deletescsi_coreand replace with a reference to the shost there.Signed-off-by John Garry <[email protected]>--- drivers/scsi/aic94xx/aic94xx_hwi.c | 2 +- drivers/scsi/aic94xx/aic94xx_init.c | 6 +++--- drivers/scsi/hisi_sas/hisi_sas_main.c | 6 +++--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 6 +++--- drivers/scsi/isci/host.h | 2 +- drivers/scsi/isci/init.c | 4 ++-- drivers/scsi/libsas/sas_ata.c | 8 ++++---- drivers/scsi/libsas/sas_discover.c | 8 ++++---- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/libsas/sas_host_smp.c | 4 ++--
Quoted 9 lines
drivers/scsi/libsas/sas_init.c | 16 ++++++++-------- drivers/scsi/libsas/sas_phy.c | 8 ++++---- drivers/scsi/libsas/sas_port.c | 6 +++--- drivers/scsi/libsas/sas_scsi_host.c | 14 +++++++------- drivers/scsi/mvsas/mv_init.c | 4 ++-- drivers/scsi/pm8001/pm8001_init.c | 2 +- include/scsi/libsas.h | 7 +------ 17 files changed, 50 insertions(+), 55 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
John Garry
reviewerPATCH 5/10 scsi: libsas: Delete sas_ssp_task.retry_count
In reply to John GarrySince libsas was introduced in commit 2908d778ab3e ("[SCSI] aic94xx: new driver"), sas_ssp_task.retry_count is only ever set, so delete it.
The aic94xx driver also had its own retry_count definition in struct scb sub-structs, which may have caused a mix-up.
--- drivers/scsi/libsas/sas_ata.c | 1 - drivers/scsi/libsas/sas_scsi_host.c | 1 - include/scsi/libsas.h | 2 -- 3 files changed, 4 deletions(-)
drivers/scsi/libsas/sas_ata.c +0 -1
@@ -201,7 +201,6 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) task->data_dir = qc->dma_dir; } task->scatter = qc->sg; - task->ata_task.retry_count =1 ; qc->lldd_task = task; task->ata_task.use_ncq =ata_is_ncq (qc->tf.protocol);
drivers/scsi/libsas/sas_scsi_host.c +0 -1
@@ -142,7 +142,6 @@ static struct sas_task *sas_create_task(struct scsi_cmnd *cmd, task->dev = dev; task->task_proto = task->dev->tproto;/* BUG_ON(!SSP) */ - task->ssp_task.retry_count =1 ;int_to_scsilun (cmd->device->lun, &lun);memcpy (task->ssp_task.LUN, &lun.scsi_lun,8 ); task->ssp_task.task_attr =TASK_ATTR_SIMPLE ;
include/scsi/libsas.h +0 -2
@@ -563,8 +563,6 @@ enum task_attribute { };struct sas_ssp_task { -u8 retry_count;/* hardware retry, should be > 0 */ -u8 LUN[8 ];u8 enable_first_burst:1 ;enum task_attribute task_attr;
Signature · 1 line
2.35.3
Re: [PATCH 05/10] scsi: libsas: Delete sas_ssp_task.retry_count
Quoted 7 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ssp_task.retry_count is only ever set, so delete it.The aic94xx driver also had its own
retry_countdefinition in struct scb sub-structs, which may have caused a mix-up.Signed-off-by John Garry <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 05/10] scsi: libsas: Delete sas_ssp_task.retry_count
In reply to John GarryQuoted 6 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ssp_task.retry_count is only ever set, so delete it.The aic94xx driver also had its own
retry_countdefinition in struct scb sub-structs, which may have caused a mix-up.
Quoted 6 lines
Signed-off-by John Garry<[email protected]>--- drivers/scsi/libsas/sas_ata.c | 1 - drivers/scsi/libsas/sas_scsi_host.c | 1 - include/scsi/libsas.h | 2 -- 3 files changed, 4 deletions(-)
Re: [PATCH 05/10] scsi: libsas: Delete sas_ssp_task.retry_count
In reply to John GarryQuoted 6 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ssp_task.retry_count is only ever set, so delete it.The aic94xx driver also had its own
retry_countdefinition in struct scb sub-structs, which may have caused a mix-up.
Quoted 7 lines
Signed-off-by John Garry <[email protected]>--- drivers/scsi/libsas/sas_ata.c | 1 - drivers/scsi/libsas/sas_scsi_host.c | 1 - include/scsi/libsas.h | 2 -- 3 files changed, 4 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
John Garry
reviewerPATCH 6/10 scsi: libsas: Delete sas_ssp_task.enable_first_burst
In reply to John GarrySince libsas was introduced in commit 2908d778ab3e ("[SCSI] aic94xx: new driver"), sas_ssp_task.enable_first_burst is never set, so delete it and any references.
--- drivers/scsi/aic94xx/aic94xx_task.c | 2 -- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 8 ++------ drivers/scsi/mvsas/mv_sas.c | 8 ++------ drivers/scsi/pm8001/pm8001_hwi.c | 2 -- drivers/scsi/pm8001/pm80xx_hwi.c | 2 -- include/scsi/libsas.h | 1 - 6 files changed, 4 insertions(+), 19 deletions(-)
drivers/scsi/aic94xx/aic94xx_task.c +0 -2
@@ -485,8 +485,6 @@ static int asd_build_ssp_ascb(struct asd_ascb *ascb, struct sas_task *task, scb->ssp_task.ssp_frame.tptt =cpu_to_be16 (0xFFFF );memcpy (scb->ssp_task.ssp_cmd.lun, task->ssp_task.LUN,8 ); -if (task->ssp_task.enable_first_burst) - scb->ssp_task.ssp_cmd.efb_prio_attr |=EFB_MASK ; scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_attr &7 ); memcpy(scb->ssp_task.ssp_cmd.cdb, task->ssp_task.cmd->cmnd,
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +2 -6
@@ -960,7 +960,7 @@ static void prep_ssp_v1_hw(struct hisi_hba *hisi_hba,struct scsi_cmnd *scsi_cmnd = ssp_task->cmd;struct sas_tmf_task *tmf = slot->tmf;int has_data =0 , priority = !!tmf; -u8 *buf_cmd, fburst =0 ; +u8 *buf_cmd;u32 dw1, dw2;/* create header */
@@ -1018,15 +1018,11 @@ static void prep_ssp_v1_hw(struct hisi_hba *hisi_hba, buf_cmd =hisi_sas_cmd_hdr_addr_mem (slot) +sizeof (struct ssp_frame_hdr ); -if (task->ssp_task.enable_first_burst) { - fburst = (1 <<7 ); - dw2 |=1 <<CMD_HDR_FIRST_BURST_OFF ; - } hdr->dw2 =cpu_to_le32 (dw2);memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (!tmf) { - buf_cmd[9 ] = fburst | task->ssp_task.task_attr | + buf_cmd[9 ] = task->ssp_task.task_attr | (task->ssp_task.task_prio <<3 );memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);
drivers/scsi/mvsas/mv_sas.c +2 -6
@@ -564,7 +564,7 @@ static int mvs_task_prep_ssp(struct mvs_info *mvi,void *buf_prd;struct ssp_frame_hdr *ssp_hdr;void *buf_tmp; -u8 *buf_cmd, *buf_oaf, fburst =0 ; +u8 *buf_cmd, *buf_oaf;dma_addr_t buf_tmp_dma;u32 flags;u32 resp_len, req_len, i, tag = tei->tag;
@@ -582,10 +582,6 @@ static int mvs_task_prep_ssp(struct mvs_info *mvi, (phy_mask << TXQ_PHY_SHIFT)); flags =MCH_RETRY ; -if (task->ssp_task.enable_first_burst) { - flags |=MCH_FBURST ; - fburst = (1 <<7 ); - }if (is_tmf) flags |= (MCH_SSP_FR_TASK <<MCH_SSP_FR_TYPE_SHIFT );else
@@ -667,7 +663,7 @@ static int mvs_task_prep_ssp(struct mvs_info *mvi,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (ssp_hdr->frame_type !=SSP_TASK ) { - buf_cmd[9 ] = fburst | task->ssp_task.task_attr | + buf_cmd[9 ] = task->ssp_task.task_attr | (task->ssp_task.task_prio <<3 );memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);
drivers/scsi/pm8001/pm8001_hwi.c +0 -2
@@ -4053,8 +4053,6 @@ static int pm8001_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha, ssp_cmd.data_len =cpu_to_le32 (task->total_xfer_len); ssp_cmd.device_id =cpu_to_le32 (pm8001_dev->device_id); ssp_cmd.tag =cpu_to_le32 (tag); -if (task->ssp_task.enable_first_burst) - ssp_cmd.ssp_iu.efb_prio_attr |=0x80 ; ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr &7 ); memcpy(ssp_cmd.ssp_iu.cdb, task->ssp_task.cmd->cmnd,
drivers/scsi/pm8001/pm80xx_hwi.c +0 -2
@@ -4316,8 +4316,6 @@ static int pm80xx_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha, ssp_cmd.data_len =cpu_to_le32 (task->total_xfer_len); ssp_cmd.device_id =cpu_to_le32 (pm8001_dev->device_id); ssp_cmd.tag =cpu_to_le32 (tag); -if (task->ssp_task.enable_first_burst) - ssp_cmd.ssp_iu.efb_prio_attr =0x80 ; ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr &7 ); memcpy(ssp_cmd.ssp_iu.cdb, task->ssp_task.cmd->cmnd,
include/scsi/libsas.h +0 -1
@@ -564,7 +564,6 @@ enum task_attribute {struct sas_ssp_task {u8 LUN[8 ]; -u8 enable_first_burst:1 ;enum task_attribute task_attr;u8 task_prio;struct scsi_cmnd *cmd;
Signature · 1 line
2.35.3
Re: [PATCH 06/10] scsi: libsas: Delete sas_ssp_task.enable_first_burst
Quoted 5 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ssp_task.enable_first_burst is never set, so delete it and any references.Signed-off-by John Garry <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 06/10] scsi: libsas: Delete sas_ssp_task.enable_first_burst
In reply to John GarryQuoted 5 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ssp_task.enable_first_burst is never set, so delete it and any references.Signed-off-by John Garry<[email protected]>
Quoted 8 lines
--- drivers/scsi/aic94xx/aic94xx_task.c | 2 -- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 8 ++------ drivers/scsi/mvsas/mv_sas.c | 8 ++------ drivers/scsi/pm8001/pm8001_hwi.c | 2 -- drivers/scsi/pm8001/pm80xx_hwi.c | 2 -- include/scsi/libsas.h | 1 - 6 files changed, 4 insertions(+), 19 deletions(-)
Re: [PATCH 06/10] scsi: libsas: Delete sas_ssp_task.enable_first_burst
In reply to John GarryQuoted 5 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ssp_task.enable_first_burst is never set, so delete it and any references.Signed-off-by John Garry <[email protected]>
Quoted 9 lines
--- drivers/scsi/aic94xx/aic94xx_task.c | 2 -- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 8 ++------ drivers/scsi/mvsas/mv_sas.c | 8 ++------ drivers/scsi/pm8001/pm8001_hwi.c | 2 -- drivers/scsi/pm8001/pm80xx_hwi.c | 2 -- include/scsi/libsas.h | 1 - 6 files changed, 4 insertions(+), 19 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
John Garry
reviewerPATCH 7/10 scsi: libsas: Delete sas_ssp_task.task_prio
In reply to John GarrySince libsas was introduced in commit 2908d778ab3e ("[SCSI] aic94xx: new driver"), sas_ssp_task.task_prio is never set, so delete it and any references which depend on it being set (all of them).
--- drivers/scsi/aic94xx/aic94xx_task.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 3 +-- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 3 +-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +- drivers/scsi/isci/request.c | 1 - drivers/scsi/mvsas/mv_sas.c | 3 +-- drivers/scsi/pm8001/pm8001_hwi.c | 1 - drivers/scsi/pm8001/pm80xx_hwi.c | 1 - include/scsi/libsas.h | 1 - 9 files changed, 4 insertions(+), 12 deletions(-)
drivers/scsi/aic94xx/aic94xx_task.c +0 -1
@@ -485,7 +485,6 @@ static int asd_build_ssp_ascb(struct asd_ascb *ascb, struct sas_task *task, scb->ssp_task.ssp_frame.tptt =cpu_to_be16 (0xFFFF );memcpy (scb->ssp_task.ssp_cmd.lun, task->ssp_task.LUN,8 ); - scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_attr &7 );memcpy (scb->ssp_task.ssp_cmd.cdb, task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +1 -2
@@ -1022,8 +1022,7 @@ static void prep_ssp_v1_hw(struct hisi_hba *hisi_hba,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (!tmf) { - buf_cmd[9 ] = task->ssp_task.task_attr | - (task->ssp_task.task_prio <<3 ); + buf_cmd[9 ] = task->ssp_task.task_attr;memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len); }else {
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +1 -2
@@ -1798,8 +1798,7 @@ static void prep_ssp_v2_hw(struct hisi_hba *hisi_hba,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (!tmf) { - buf_cmd[9 ] = task->ssp_task.task_attr | - (task->ssp_task.task_prio <<3 ); + buf_cmd[9 ] = task->ssp_task.task_attr;memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len); }else {
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 -1
@@ -1326,7 +1326,7 @@ static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (!tmf) { - buf_cmd[9 ] = ssp_task->task_attr | (ssp_task->task_prio <<3 ); + buf_cmd[9 ] = ssp_task->task_attr;memcpy (buf_cmd +12 , scsi_cmnd->cmnd, scsi_cmnd->cmd_len); }else { buf_cmd[10 ] = tmf->tmf;
drivers/scsi/isci/request.c +0 -1
@@ -180,7 +180,6 @@ static void sci_io_request_build_ssp_command_iu(struct isci_request *ireq) cmd_iu->_r_a =0 ; cmd_iu->_r_b =0 ; cmd_iu->en_fburst =0 ;/* unsupported */ - cmd_iu->task_prio = task->ssp_task.task_prio; cmd_iu->task_attr = task->ssp_task.task_attr; cmd_iu->_r_c =0 ;
drivers/scsi/mvsas/mv_sas.c +1 -2
@@ -663,8 +663,7 @@ static int mvs_task_prep_ssp(struct mvs_info *mvi,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (ssp_hdr->frame_type !=SSP_TASK ) { - buf_cmd[9 ] = task->ssp_task.task_attr | - (task->ssp_task.task_prio <<3 ); + buf_cmd[9 ] = task->ssp_task.task_attr;memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len); }else {
drivers/scsi/pm8001/pm8001_hwi.c +0 -1
@@ -4053,7 +4053,6 @@ static int pm8001_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha, ssp_cmd.data_len =cpu_to_le32 (task->total_xfer_len); ssp_cmd.device_id =cpu_to_le32 (pm8001_dev->device_id); ssp_cmd.tag =cpu_to_le32 (tag); - ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr &7 );memcpy (ssp_cmd.ssp_iu.cdb, task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);
drivers/scsi/pm8001/pm80xx_hwi.c +0 -1
@@ -4316,7 +4316,6 @@ static int pm80xx_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha, ssp_cmd.data_len =cpu_to_le32 (task->total_xfer_len); ssp_cmd.device_id =cpu_to_le32 (pm8001_dev->device_id); ssp_cmd.tag =cpu_to_le32 (tag); - ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr &7 );memcpy (ssp_cmd.ssp_iu.cdb, task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);
include/scsi/libsas.h +0 -1
@@ -565,7 +565,6 @@ enum task_attribute {struct sas_ssp_task {u8 LUN[8 ];enum task_attribute task_attr; -u8 task_prio;struct scsi_cmnd *cmd; };
Signature · 1 line
2.35.3
Re: [PATCH 07/10] scsi: libsas: Delete sas_ssp_task.task_prio
Quoted 75 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ssp_task.task_prio is never set, so delete it and any references which depend on it being set (all of them).Signed-off-by John Garry <[email protected]>--- drivers/scsi/aic94xx/aic94xx_task.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 3 +-- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 3 +-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +- drivers/scsi/isci/request.c | 1 - drivers/scsi/mvsas/mv_sas.c | 3 +-- drivers/scsi/pm8001/pm8001_hwi.c | 1 - drivers/scsi/pm8001/pm80xx_hwi.c | 1 - include/scsi/libsas.h | 1 - 9 files changed, 4 insertions(+), 12 deletions(-)drivers/scsi/aic94xx/aic94xx_task.c +0
-1@@ -485,7 +485,6 @@ static int asd_build_ssp_ascb(struct asd_ascb *ascb, struct sas_task *task, scb->ssp_task.ssp_frame.tptt =cpu_to_be16 (0xFFFF );memcpy (scb->ssp_task.ssp_cmd.lun, task->ssp_task.LUN,8 ); - scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_attr &7 );memcpy (scb->ssp_task.ssp_cmd.cdb, task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +1
-2@@ -1022,8 +1022,7 @@ static void prep_ssp_v1_hw(struct hisi_hba *hisi_hba,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (!tmf) { - buf_cmd[9 ] = task->ssp_task.task_attr | - (task->ssp_task.task_prio <<3 ); + buf_cmd[9 ] = task->ssp_task.task_attr;memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len); }else {drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +1
-2@@ -1798,8 +1798,7 @@ static void prep_ssp_v2_hw(struct hisi_hba *hisi_hba,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (!tmf) { - buf_cmd[9 ] = task->ssp_task.task_attr | - (task->ssp_task.task_prio <<3 ); + buf_cmd[9 ] = task->ssp_task.task_attr;memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len); }else {drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1
-1@@ -1326,7 +1326,7 @@ static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (!tmf) { - buf_cmd[9 ] = ssp_task->task_attr | (ssp_task->task_prio <<3 ); + buf_cmd[9 ] = ssp_task->task_attr;memcpy (buf_cmd +12 , scsi_cmnd->cmnd, scsi_cmnd->cmd_len); }else { buf_cmd[10 ] = tmf->tmf;drivers/scsi/isci/request.c +0
-0
drivers/scsi/isci/request.c static void sci_io_request_build_ssp_command_iu(struct isci_request *ireq) · line 183
Quoted 4 lines
drivers/scsi/isci/request.c +0
-1@@ -180,7 +180,6 @@ static void sci_io_request_build_ssp_command_iu(struct isci_request *ireq) cmd_iu->_r_a =0 ; cmd_iu->_r_b =0 ; cmd_iu->en_fburst =0 ;/* unsupported */ - cmd_iu->task_prio = task->ssp_task.task_prio;
Shouldn't this be replaced with:
cmd_iu->task_prio = 0;
? (note sure how cmd_iu is being initialized, but given that the other fields around this code are assigned 0, I would guess this one needs that as well...)
Quoted 53 lines
drivers/scsi/isci/request.c +0
-0cmd_iu->task_attr = task->ssp_task.task_attr; cmd_iu->_r_c =0 ;drivers/scsi/mvsas/mv_sas.c +1
-2@@ -663,8 +663,7 @@ static int mvs_task_prep_ssp(struct mvs_info *mvi,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (ssp_hdr->frame_type !=SSP_TASK ) { - buf_cmd[9 ] = task->ssp_task.task_attr | - (task->ssp_task.task_prio <<3 ); + buf_cmd[9 ] = task->ssp_task.task_attr;memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len); }else {drivers/scsi/pm8001/pm8001_hwi.c +0
-1@@ -4053,7 +4053,6 @@ static int pm8001_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha, ssp_cmd.data_len =cpu_to_le32 (task->total_xfer_len); ssp_cmd.device_id =cpu_to_le32 (pm8001_dev->device_id); ssp_cmd.tag =cpu_to_le32 (tag); - ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr &7 );memcpy (ssp_cmd.ssp_iu.cdb, task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);drivers/scsi/pm8001/pm80xx_hwi.c +0
-1@@ -4316,7 +4316,6 @@ static int pm80xx_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha, ssp_cmd.data_len =cpu_to_le32 (task->total_xfer_len); ssp_cmd.device_id =cpu_to_le32 (pm8001_dev->device_id); ssp_cmd.tag =cpu_to_le32 (tag); - ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr &7 );memcpy (ssp_cmd.ssp_iu.cdb, task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);include/scsi/libsas.h +0
-1@@ -565,7 +565,6 @@ enum task_attribute {struct sas_ssp_task {u8 LUN[8 ];enum task_attribute task_attr; -u8 task_prio;struct scsi_cmnd *cmd; };
Signature · 2 lines
Damien Le Moal Western Digital Research
John Garry
reviewerRe: [PATCH 07/10] scsi: libsas: Delete sas_ssp_task.task_prio
Quoted 9 lines · Damien Le Moal
drivers/scsi/isci/request.c static void sci_io_request_build_ssp_command_iu(struct isci_request *ireq) · line 183
Quoted 7 lines
drivers/scsi/isci/request.c +0
-1@@ -180,7 +180,6 @@ static void sci_io_request_build_ssp_command_iu(struct isci_request *ireq) cmd_iu->_r_a =0 ; cmd_iu->_r_b =0 ; cmd_iu->en_fburst =0 ;/* unsupported */ - cmd_iu->task_prio = task->ssp_task.task_prio;Shouldn't this be replaced with:
Quoted 5 lines
cmd_iu->task_prio = 0;? (note sure how
cmd_iuis being initialized, but given that the other fields around this code are assigned 0, I would guess this one needs that as well...)
Yeah, I think that you are right - I'll fix that up. Thanks for checking very carefully.
John
Re: [PATCH 07/10] scsi: libsas: Delete sas_ssp_task.task_prio
In reply to John GarryQuoted 125 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ssp_task.task_prio is never set, so delete it and any references which depend on it being set (all of them).Signed-off-by John Garry <[email protected]>--- drivers/scsi/aic94xx/aic94xx_task.c | 1 - drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 3 +-- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 3 +-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +- drivers/scsi/isci/request.c | 1 - drivers/scsi/mvsas/mv_sas.c | 3 +-- drivers/scsi/pm8001/pm8001_hwi.c | 1 - drivers/scsi/pm8001/pm80xx_hwi.c | 1 - include/scsi/libsas.h | 1 - 9 files changed, 4 insertions(+), 12 deletions(-)drivers/scsi/aic94xx/aic94xx_task.c +0
-1@@ -485,7 +485,6 @@ static int asd_build_ssp_ascb(struct asd_ascb *ascb, struct sas_task *task, scb->ssp_task.ssp_frame.tptt =cpu_to_be16 (0xFFFF );memcpy (scb->ssp_task.ssp_cmd.lun, task->ssp_task.LUN,8 ); - scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_attr &7 );memcpy (scb->ssp_task.ssp_cmd.cdb, task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +1
-2@@ -1022,8 +1022,7 @@ static void prep_ssp_v1_hw(struct hisi_hba *hisi_hba,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (!tmf) { - buf_cmd[9 ] = task->ssp_task.task_attr | - (task->ssp_task.task_prio <<3 ); + buf_cmd[9 ] = task->ssp_task.task_attr;memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len); }else {drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +1
-2@@ -1798,8 +1798,7 @@ static void prep_ssp_v2_hw(struct hisi_hba *hisi_hba,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (!tmf) { - buf_cmd[9 ] = task->ssp_task.task_attr | - (task->ssp_task.task_prio <<3 ); + buf_cmd[9 ] = task->ssp_task.task_attr;memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len); }else {drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1
-1@@ -1326,7 +1326,7 @@ static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (!tmf) { - buf_cmd[9 ] = ssp_task->task_attr | (ssp_task->task_prio <<3 ); + buf_cmd[9 ] = ssp_task->task_attr;memcpy (buf_cmd +12 , scsi_cmnd->cmnd, scsi_cmnd->cmd_len); }else { buf_cmd[10 ] = tmf->tmf;drivers/scsi/isci/request.c +0
-1@@ -180,7 +180,6 @@ static void sci_io_request_build_ssp_command_iu(struct isci_request *ireq) cmd_iu->_r_a =0 ; cmd_iu->_r_b =0 ; cmd_iu->en_fburst =0 ;/* unsupported */ - cmd_iu->task_prio = task->ssp_task.task_prio; cmd_iu->task_attr = task->ssp_task.task_attr; cmd_iu->_r_c =0 ;drivers/scsi/mvsas/mv_sas.c +1
-2@@ -663,8 +663,7 @@ static int mvs_task_prep_ssp(struct mvs_info *mvi,memcpy (buf_cmd, &task->ssp_task.LUN,8 );if (ssp_hdr->frame_type !=SSP_TASK ) { - buf_cmd[9 ] = task->ssp_task.task_attr | - (task->ssp_task.task_prio <<3 ); + buf_cmd[9 ] = task->ssp_task.task_attr;memcpy (buf_cmd +12 , task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len); }else {drivers/scsi/pm8001/pm8001_hwi.c +0
-1@@ -4053,7 +4053,6 @@ static int pm8001_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha, ssp_cmd.data_len =cpu_to_le32 (task->total_xfer_len); ssp_cmd.device_id =cpu_to_le32 (pm8001_dev->device_id); ssp_cmd.tag =cpu_to_le32 (tag); - ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr &7 );memcpy (ssp_cmd.ssp_iu.cdb, task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);drivers/scsi/pm8001/pm80xx_hwi.c +0
-1@@ -4316,7 +4316,6 @@ static int pm80xx_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha, ssp_cmd.data_len =cpu_to_le32 (task->total_xfer_len); ssp_cmd.device_id =cpu_to_le32 (pm8001_dev->device_id); ssp_cmd.tag =cpu_to_le32 (tag); - ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio <<3 ); ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr &7 );memcpy (ssp_cmd.ssp_iu.cdb, task->ssp_task.cmd->cmnd, task->ssp_task.cmd->cmd_len);include/scsi/libsas.h +0
-0
include/scsi/libsas.h enum task_attribute { · line 570
Quoted 7 lines
include/scsi/libsas.h +0
-1@@ -565,7 +565,6 @@ enum task_attribute {struct sas_ssp_task {u8 LUN[8 ];enum task_attribute task_attr; -u8 task_prio;struct scsi_cmnd *cmd; };
Hmm. While true in general, we lose information on how the 'prio' field is coded for the various drivers. Would it be an idea to use explicitly state TASK_ATTR_SIMPLE
in the various drivers such that we know what to fix if we ever
decide to bring task attributes back to life?
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
John Garry
reviewerRe: [PATCH 07/10] scsi: libsas: Delete sas_ssp_task.task_prio
Quoted 7 lines · Hannes Reinecke
Quoted 7 lines
include/scsi/libsas.h +0
-0@@ -565,7 +565,6 @@ enum task_attribute { struct sas_ssp_task { u8 LUN[8];
Quoted 8 lines
include/scsi/libsas.h enum task_attribute { · line 569
Quoted 4 lines
include/scsi/libsas.h +0
-1enum task_attribute task_attr; - u8 task_prio; struct scsi_cmnd *cmd; };Hmm. While true in general, we lose information on how the 'prio' field is coded for the various drivers. Would it be an idea to use explicitly state
TASK_ATTR_SIMPLE
in the various drivers such that we know what to fix if we ever
decide to bring task attributes back to life?
The HW encoding for these drivers is the same as in the SAS COMMAND frame - Command information unit structure, right? So the amount of info lost is reduced. And we also have source control history.
I'd be more inclined to get rid of setting task attributes similarly as well.
Thanks,
John
Hannes Reinecke
Reviewed-byRe: [PATCH 07/10] scsi: libsas: Delete sas_ssp_task.task_prio
Quoted 17 lines · John Garry
Quoted 7 lines · Hannes Reinecke
Quoted 7 lines
include/scsi/libsas.h +0
-0@@ -565,7 +565,6 @@ enum task_attribute { struct sas_ssp_task { u8 LUN[8];Quoted 8 lines
include/scsi/libsas.h enum task_attribute { · line 569
Quoted 4 lines
include/scsi/libsas.h +0
-1enum task_attribute task_attr; - u8 task_prio; struct scsi_cmnd *cmd; };Hmm. While true in general, we lose information on how the 'prio' field is coded for the various drivers. Would it be an idea to use explicitly state
TASK_ATTR_SIMPLE
in the various drivers such that we know what to fix if we ever
decide to bring task attributes back to life?
Quoted 4 lines
The HW encoding for these drivers is the same as in the SAS COMMAND frame - Command information unit structure, right? So the amount of info lost is reduced. And we also have source control history.
I'd be more inclined to get rid of setting task attributes similarly as well.
Fair enough.
Cheers,
Hannes
John Garry
reviewerPATCH 8/10 scsi: libsas: Delete sas_ata_task.set_affil_pol
In reply to John GarrySince libsas was introduced in commit 2908d778ab3e ("[SCSI] aic94xx: new driver"), sas_ata_task.set_affil_pol is never set, so delete it and the reference in asd_build_ata_ascb().
--- drivers/scsi/aic94xx/aic94xx_task.c | 7 +++---- include/scsi/libsas.h | 1 - 2 files changed, 3 insertions(+), 5 deletions(-)
drivers/scsi/aic94xx/aic94xx_task.c +3 -4
@@ -390,11 +390,10 @@ static int asd_build_ata_ascb(struct asd_ascb *ascb, struct sas_task *task, scb->ata_task.retry_count = task->ata_task.retry_count; - flags =0 ; -if (task->ata_task.set_affil_pol) - flags |=SET_AFFIL_POLICY ;if (task->ata_task.stp_affil_pol) - flags |=STP_AFFIL_POLICY ; + flags =STP_AFFIL_POLICY ; +else + flags =0 ; scb->ata_task.flags = flags; } ascb->tasklet_complete = asd_task_tasklet_complete;
include/scsi/libsas.h +0 -1
@@ -529,7 +529,6 @@ struct sas_ata_task { u8 dma_xfer:1; /* PIO:0 or DMA:1 */ u8 use_ncq:1; - u8 set_affil_pol:1; u8 stp_affil_pol:1; u8 device_control_reg_update:1;
Signature · 1 line
2.35.3
Re: [PATCH 08/10] scsi: libsas: Delete sas_ata_task.set_affil_pol
Quoted 5 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ata_task.set_affil_pol is never set, so delete it and the reference inasd_build_ata_ascb().Signed-off-by John Garry <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 08/10] scsi: libsas: Delete sas_ata_task.set_affil_pol
In reply to John GarryQuoted 9 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ata_task.set_affil_pol is never set, so delete it and the reference inasd_build_ata_ascb().Signed-off-by John Garry<[email protected]>--- drivers/scsi/aic94xx/aic94xx_task.c | 7 +++---- include/scsi/libsas.h | 1 - 2 files changed, 3 insertions(+), 5 deletions(-)
Re: [PATCH 08/10] scsi: libsas: Delete sas_ata_task.set_affil_pol
In reply to John GarryQuoted 10 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ata_task.set_affil_pol is never set, so delete it and the reference inasd_build_ata_ascb().Signed-off-by John Garry <[email protected]>--- drivers/scsi/aic94xx/aic94xx_task.c | 7 +++---- include/scsi/libsas.h | 1 - 2 files changed, 3 insertions(+), 5 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
John Garry
reviewerPATCH 9/10 scsi: libsas: Delete sas_ata_task.stp_affil_pol
In reply to John GarrySince libsas was introduced in commit 2908d778ab3e ("[SCSI] aic94xx: new driver"), sas_ata_task.stp_affil_pol is never set, so delete it and the reference in asd_build_ata_ascb().
--- drivers/scsi/aic94xx/aic94xx_task.c | 6 +----- include/scsi/libsas.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/scsi/aic94xx/aic94xx_task.c +1 -5
@@ -390,11 +390,7 @@ static int asd_build_ata_ascb(struct asd_ascb *ascb, struct sas_task *task, scb->ata_task.retry_count = task->ata_task.retry_count; -if (task->ata_task.stp_affil_pol) - flags =STP_AFFIL_POLICY ; -else - flags =0 ; - scb->ata_task.flags = flags; + scb->ata_task.flags =0 ; } ascb->tasklet_complete = asd_task_tasklet_complete;
include/scsi/libsas.h +0 -1
@@ -529,7 +529,6 @@ struct sas_ata_task { u8 dma_xfer:1; /* PIO:0 or DMA:1 */ u8 use_ncq:1; - u8 stp_affil_pol:1; u8 device_control_reg_update:1;
Signature · 1 line
2.35.3
Re: [PATCH 09/10] scsi: libsas: Delete sas_ata_task.stp_affil_pol
Quoted 5 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ata_task.stp_affil_pol is never set, so delete it and the reference inasd_build_ata_ascb().Signed-off-by John Garry <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 09/10] scsi: libsas: Delete sas_ata_task.stp_affil_pol
In reply to John GarryQuoted 9 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ata_task.stp_affil_pol is never set, so delete it and the reference inasd_build_ata_ascb().Signed-off-by John Garry<[email protected]>--- drivers/scsi/aic94xx/aic94xx_task.c | 6 +----- include/scsi/libsas.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-)
Re: [PATCH 09/10] scsi: libsas: Delete sas_ata_task.stp_affil_pol
In reply to John GarryQuoted 10 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ata_task.stp_affil_pol is never set, so delete it and the reference inasd_build_ata_ascb().Signed-off-by John Garry <[email protected]>--- drivers/scsi/aic94xx/aic94xx_task.c | 6 +----- include/scsi/libsas.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman
John Garry
reviewerPATCH 10/10 scsi: libsas: Delete sas_ata_task.retry_count
In reply to John GarrySince libsas was introduced in commit 2908d778ab3e ("[SCSI] aic94xx: new driver"), sas_ata_task.retry_count is never set, so delete it and the reference in asd_build_ata_ascb().
--- drivers/scsi/aic94xx/aic94xx_task.c | 2 +- include/scsi/libsas.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/aic94xx/aic94xx_task.c +1 -1
@@ -388,7 +388,7 @@ static int asd_build_ata_ascb(struct asd_ascb *ascb, struct sas_task *task, flags |= data_dir_flags[task->data_dir]; scb->ata_task.ata_flags = flags; - scb->ata_task.retry_count = task->ata_task.retry_count; + scb->ata_task.retry_count =0 ; scb->ata_task.flags =0 ; }
include/scsi/libsas.h +0 -2
@@ -525,8 +525,6 @@ struct sas_ata_task {struct host_to_dev_fis fis;u8 atapi_packet[16 ];/* 0 if not ATAPI task */ -u8 retry_count;/* hardware retry, should be > 0 */ - u8 dma_xfer:1; /* PIO:0 or DMA:1 */ u8 use_ncq:1;
Signature · 1 line
2.35.3
Re: [PATCH 10/10] scsi: libsas: Delete sas_ata_task.retry_count
Quoted 5 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ata_task.retry_count is never set, so delete it and the reference inasd_build_ata_ascb().Signed-off-by John Garry <[email protected]>
Looks good.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 10/10] scsi: libsas: Delete sas_ata_task.retry_count
In reply to John GarryQuoted 9 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ata_task.retry_count is never set, so delete it and the reference inasd_build_ata_ascb().Signed-off-by John Garry<[email protected]>--- drivers/scsi/aic94xx/aic94xx_task.c | 2 +- include/scsi/libsas.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
Re: [PATCH 10/10] scsi: libsas: Delete sas_ata_task.retry_count
In reply to John GarryQuoted 10 lines · John Garry
Since libsas was introduced in commit
2908d778ab3e("[SCSI] aic94xx: new driver"), sas_ata_task.retry_count is never set, so delete it and the reference inasd_build_ata_ascb().Signed-off-by John Garry <[email protected]>--- drivers/scsi/aic94xx/aic94xx_task.c | 2 +- include/scsi/libsas.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman