From a615e93d6cfe70f9fab2cb02c7b11fe9de1c56b5 Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Tue, 25 Jul 2023 22:15:31 +0800 Subject: scsi: iscsi: Remove unused extern declaration iscsi_lookup_iface() This is not used anymore and can be removed. Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20230725141531.10424-1-yuehaibing@huawei.com Reviewed-by: Chris Leech Signed-off-by: Martin K. Petersen --- include/scsi/scsi_transport_iscsi.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/scsi') diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 34c03707fb6e..fb3399e4cd29 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -472,7 +472,6 @@ extern struct iscsi_iface *iscsi_create_iface(struct Scsi_Host *shost, uint32_t iface_type, uint32_t iface_num, int dd_size); extern void iscsi_destroy_iface(struct iscsi_iface *iface); -extern struct iscsi_iface *iscsi_lookup_iface(int handle); extern char *iscsi_get_port_speed_name(struct Scsi_Host *shost); extern char *iscsi_get_port_state_name(struct Scsi_Host *shost); extern int iscsi_is_session_dev(const struct device *dev); -- cgit From 2fcd1e2b648fca02c6a1d623bbd9ca20d49cdafe Mon Sep 17 00:00:00 2001 From: Yue Haibing Date: Wed, 9 Aug 2023 21:22:49 +0800 Subject: scsi: libsas: Remove unused declarations Commit 042ebd293b86 ("scsi: libsas: kill useless ha_event and do some cleanup") removed sas_hae_reset() but not its declaration. Commit 2908d778ab3e ("[SCSI] aic94xx: new driver") declared but never implemented other functions. Signed-off-by: Yue Haibing Link: https://lore.kernel.org/r/20230809132249.37948-1-yuehaibing@huawei.com Reviewed-by: John Garry Reviewed-by: Jason Yan Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 159823e0afbf..8557a0caf5fe 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -727,8 +727,6 @@ extern struct device_attribute dev_attr_phy_event_threshold; int sas_discover_root_expander(struct domain_device *); -void sas_init_ex_attr(void); - int sas_ex_revalidate_domain(struct domain_device *); void sas_unregister_domain_devices(struct asd_sas_port *port, int gone); -- cgit From 62ec2092095b678ff89ce4ba51c2938cd1e8e630 Mon Sep 17 00:00:00 2001 From: Tony Battersby Date: Mon, 14 Aug 2023 10:03:25 -0400 Subject: scsi: core: Use 32-bit hostnum in scsi_host_lookup() Change scsi_host_lookup() hostnum argument type from unsigned short to unsigned int to match the type used everywhere else. Fixes: 6d49f63b415c ("[SCSI] Make host_no an unsigned int") Signed-off-by: Tony Battersby Link: https://lore.kernel.org/r/a02497e7-c12b-ef15-47fc-3f0a0b00ffce@cybernetics.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- include/scsi/scsi_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/scsi') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 70b7475dcf56..a2b8d30c4c80 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -769,7 +769,7 @@ extern void scsi_remove_host(struct Scsi_Host *); extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); extern int scsi_host_busy(struct Scsi_Host *shost); extern void scsi_host_put(struct Scsi_Host *t); -extern struct Scsi_Host *scsi_host_lookup(unsigned short); +extern struct Scsi_Host *scsi_host_lookup(unsigned int hostnum); extern const char *scsi_host_state_name(enum scsi_host_state); extern void scsi_host_complete_all_commands(struct Scsi_Host *shost, enum scsi_host_status status); -- cgit From 72875018f638d02db09f74cbe181dc76a75bc970 Mon Sep 17 00:00:00 2001 From: Igor Pylypiv Date: Sat, 19 Aug 2023 14:30:39 -0700 Subject: scsi: libsas: Add return_fis_on_success to sas_ata_task Set return_fis_on_success when libata requests result taskfile. For Command Duration Limits policy 0xD (command completes without an error) libata needs FIS in order to detect the ATA_SENSE bit and read the Sense Data for Successful NCQ Commands log (0Fh). Signed-off-by: Igor Pylypiv Link: https://lore.kernel.org/r/20230819213040.1101044-2-ipylypiv@google.com Reviewed-by: Niklas Cassel Reviewed-by: Damien Le Moal Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 159823e0afbf..9e2c69c13dd3 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -550,6 +550,7 @@ struct sas_ata_task { u8 use_ncq:1; u8 set_affil_pol:1; u8 stp_affil_pol:1; + u8 return_fis_on_success:1; u8 device_control_reg_update:1; -- cgit From b1bc4973177035bce5a5e0483abbbe12e6f9005b Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 15 Aug 2023 11:51:47 +0000 Subject: 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. Signed-off-by: John Garry Link: https://lore.kernel.org/r/20230815115156.343535-2-john.g.garry@oracle.com Reviewed-by: Damien Le Moal Reviewed-by: Jason Yan Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 159823e0afbf..ccaf8f6b1055 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -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; -- cgit From c46a91709335ef8fccec082201e758531aee1c8f Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 15 Aug 2023 11:51:48 +0000 Subject: scsi: libsas: Delete enum sas_class enum 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. Signed-off-by: John Garry Link: https://lore.kernel.org/r/20230815115156.343535-3-john.g.garry@oracle.com Reviewed-by: Damien Le Moal Reviewed-by: Jason Yan Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index ccaf8f6b1055..3048660ff107 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -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; -- cgit From 2f4e20cd6ef8083f911e4f8bba3c0a99815b44f4 Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 15 Aug 2023 11:51:49 +0000 Subject: scsi: libsas: Delete enum sas_phy_type enum sas_phy_type is used for asd_sas_phy.type, which is only ever set, so delete this member and the enum. Signed-off-by: John Garry Link: https://lore.kernel.org/r/20230815115156.343535-4-john.g.garry@oracle.com Reviewed-by: Damien Le Moal Reviewed-by: Jason Yan Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 3048660ff107..e54bcdc1ecd1 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -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; -- cgit From 1136a0225d0582c4464fa37e3a91ed4b19b8745e Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 15 Aug 2023 11:51:50 +0000 Subject: scsi: libsas: Delete struct scsi_core Since 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. Signed-off-by: John Garry Link: https://lore.kernel.org/r/20230815115156.343535-5-john.g.garry@oracle.com Reviewed-by: Jason Yan Reviewed-by: Damien Le Moal Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index e54bcdc1ecd1..d42bfdff7812 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -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; -- cgit From 31d9061b475c0b05b69126e6c2c063c98fa7bd8e Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 15 Aug 2023 11:51:51 +0000 Subject: scsi: libsas: Delete sas_ssp_task.retry_count 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_count definition in struct scb sub-structs, which may have caused a mix-up. Signed-off-by: John Garry Link: https://lore.kernel.org/r/20230815115156.343535-6-john.g.garry@oracle.com Reviewed-by: Jason Yan Reviewed-by: Damien Le Moal Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index d42bfdff7812..d8222c442640 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -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; -- cgit From ebf26e93cfece20765bc2a562f7adc4340b2e4cc Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 15 Aug 2023 11:51:52 +0000 Subject: scsi: libsas: Delete sas_ssp_task.enable_first_burst 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 Link: https://lore.kernel.org/r/20230815115156.343535-7-john.g.garry@oracle.com Reviewed-by: Damien Le Moal Reviewed-by: Jason Yan Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index d8222c442640..d77db53cbd8d 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -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; -- cgit From 4dc051eb0c6b6c4580e5fc61f409bf711013bc35 Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 15 Aug 2023 11:51:53 +0000 Subject: scsi: libsas: Delete sas_ssp_task.task_prio 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 Link: https://lore.kernel.org/r/20230815115156.343535-8-john.g.garry@oracle.com Reviewed-by: Damien Le Moal Reviewed-by: Jason Yan Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index d77db53cbd8d..5b2e6932c564 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -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; }; -- cgit From 7b964c4022852c02c0b586e786252b470e4bc479 Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 15 Aug 2023 11:51:54 +0000 Subject: scsi: libsas: Delete sas_ata_task.set_affil_pol 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 in asd_build_ata_ascb(). Signed-off-by: John Garry Link: https://lore.kernel.org/r/20230815115156.343535-9-john.g.garry@oracle.com Reviewed-by: Damien Le Moal Reviewed-by: Jason Yan Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 5b2e6932c564..3a52094090a1 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -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; -- cgit From 44862dc2d2e7b26f6bf30da6bbed8586b48d4400 Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 15 Aug 2023 11:51:55 +0000 Subject: scsi: libsas: Delete sas_ata_task.stp_affil_pol 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 in asd_build_ata_ascb(). Signed-off-by: John Garry Link: https://lore.kernel.org/r/20230815115156.343535-10-john.g.garry@oracle.com Reviewed-by: Damien Le Moal Reviewed-by: Jason Yan Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 3a52094090a1..a65c16643315 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -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; -- cgit From 86344494e3649a487650fb9ea535e29fc891ab95 Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 15 Aug 2023 11:51:56 +0000 Subject: scsi: libsas: Delete sas_ata_task.retry_count 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 in asd_build_ata_ascb(). Signed-off-by: John Garry Link: https://lore.kernel.org/r/20230815115156.343535-11-john.g.garry@oracle.com Reviewed-by: Damien Le Moal Reviewed-by: Jason Yan Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index a65c16643315..2601f5775a99 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -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; -- cgit