From d10b11dcb08f064aae5357578246588f08d3d127 Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Wed, 13 Sep 2023 08:05:49 +0900 Subject: scsi: libsas: Move local functions declarations to sas_internal.h Move the declarations of functions used only within libsas from include/scsi/libsas.h to drivers/scsi/libsas/sas_internal.h Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230912230551.454357-2-dlemoal@kernel.org Reviewed-by: John Garry Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen --- include/scsi/libsas.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'include/scsi') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 8a43534eea5c..2e800690b127 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -404,8 +404,6 @@ cmd_to_domain_dev(struct scsi_cmnd *cmd) return sdev_to_domain_dev(cmd->device); } -void sas_hash_addr(u8 *hashed, const u8 *sas_addr); - /* Before calling a notify event, LLDD should use this function * when the link is severed (possibly from its tasklet). * The idea is that the Class only reads those, while the LLDD, @@ -699,20 +697,8 @@ extern struct scsi_transport_template * sas_domain_attach_transport(struct sas_domain_function_template *); extern struct device_attribute dev_attr_phy_event_threshold; -int sas_discover_root_expander(struct domain_device *); - -int sas_ex_revalidate_domain(struct domain_device *); - -void sas_unregister_domain_devices(struct asd_sas_port *port, int gone); -void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *); -void sas_discover_event(struct asd_sas_port *, enum discover_event ev); - int sas_discover_end_dev(struct domain_device *); -void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *); - -void sas_init_dev(struct domain_device *); - void sas_task_abort(struct sas_task *); int sas_eh_abort_handler(struct scsi_cmnd *cmd); int sas_eh_device_reset_handler(struct scsi_cmnd *cmd); -- cgit v1.2.3-58-ga151 From 9b52c1c6cafd7ebec34f1d2e5e3cdb1a0dffe81b Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Wed, 13 Sep 2023 08:05:50 +0900 Subject: scsi: libsas: Declare sas_set_phy_speed() static sas_set_phy_speed() is used only within sas_init.c. Declare this function as static. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230912230551.454357-3-dlemoal@kernel.org Reviewed-by: John Garry Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen --- drivers/scsi/libsas/sas_init.c | 4 ++-- include/scsi/libsas.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'include/scsi') diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c index 8586dc79f2a0..9c8cc723170d 100644 --- a/drivers/scsi/libsas/sas_init.c +++ b/drivers/scsi/libsas/sas_init.c @@ -315,8 +315,8 @@ int sas_phy_reset(struct sas_phy *phy, int hard_reset) } EXPORT_SYMBOL_GPL(sas_phy_reset); -int sas_set_phy_speed(struct sas_phy *phy, - struct sas_phy_linkrates *rates) +static int sas_set_phy_speed(struct sas_phy *phy, + struct sas_phy_linkrates *rates) { int ret; diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 2e800690b127..d3ace28ee41f 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -679,7 +679,6 @@ extern void sas_resume_ha(struct sas_ha_struct *sas_ha); extern void sas_resume_ha_no_sync(struct sas_ha_struct *sas_ha); extern void sas_suspend_ha(struct sas_ha_struct *sas_ha); -int sas_set_phy_speed(struct sas_phy *phy, struct sas_phy_linkrates *rates); int sas_phy_reset(struct sas_phy *phy, int hard_reset); int sas_phy_enable(struct sas_phy *phy, int enable); extern int sas_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); -- cgit v1.2.3-58-ga151 From 1345a7d909a3c2bcb588667c676a44cb6176b64a Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Wed, 13 Sep 2023 08:05:51 +0900 Subject: scsi: libsas: Declare sas_discover_end_dev() static sas_discover_end_dev() is defined and used only in sas_discover.c. Define this function as static. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230912230551.454357-4-dlemoal@kernel.org Reviewed-by: John Garry Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen --- drivers/scsi/libsas/sas_discover.c | 2 +- include/scsi/libsas.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'include/scsi') diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index ff7b63b10aeb..8fb7c41c0962 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -275,7 +275,7 @@ static void sas_resume_devices(struct work_struct *work) * * See comment in sas_discover_sata(). */ -int sas_discover_end_dev(struct domain_device *dev) +static int sas_discover_end_dev(struct domain_device *dev) { return sas_notify_lldd_dev_found(dev); } diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index d3ace28ee41f..f5257103fdb6 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -696,8 +696,6 @@ extern struct scsi_transport_template * sas_domain_attach_transport(struct sas_domain_function_template *); extern struct device_attribute dev_attr_phy_event_threshold; -int sas_discover_end_dev(struct domain_device *); - void sas_task_abort(struct sas_task *); int sas_eh_abort_handler(struct scsi_cmnd *cmd); int sas_eh_device_reset_handler(struct scsi_cmnd *cmd); -- cgit v1.2.3-58-ga151 From 82f52b2cd5fccc61290e14c970f1280791ca4dee Mon Sep 17 00:00:00 2001 From: Wenchao Hao Date: Wed, 18 Oct 2023 19:37:46 +0800 Subject: scsi: core: Add comment to target_destroy in scsi_host_template Add comment to indicate that the callback function target_destroy in the scsi_host_template must not sleep. Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231018113746.1940197-3-haowenchao2@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- include/scsi/scsi_host.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/scsi') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 49f768d0ff37..2c61dd30d766 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -245,6 +245,9 @@ struct scsi_host_template { * midlayer calls this point so that the driver may deallocate * and terminate any references to the target. * + * Note: This callback is called with the host lock held and hence + * must not sleep. + * * Status: OPTIONAL */ void (* target_destroy)(struct scsi_target *); -- cgit v1.2.3-58-ga151