diff mbox series

[4/4] scsi: hisi_sas: Remove hisi_hba->timer for v3 hw

Message ID 1705904747-62186-5-git-send-email-chenxiang66@hisilicon.com
State New
Headers show
Series scsi: hisi_sas: Minor fixes and cleanups | expand

Commit Message

chenxiang Jan. 22, 2024, 6:25 a.m. UTC
From: Xiang Chen <chenxiang66@hisilicon.com>

Hisi_hba->timer is not used for v3 hw actually, but there are two places
that some operations related to hisi_hba->timer is calling by v3 hw:
- delete the timer in function hisi_sas_v3_hw() which is only for v3 hw;
- delete the timer in function hisi_sas_controller_reset_prepare() which
is common for v1/v2/v3 hw

We can remove it in the first place, but for the second place we need to
remove it only for v3 hw, so check hw->sht which is Null only for v3 hw
before deleting hisi_hba->timer.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c  | 7 ++++++-
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 -
 2 files changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 0b66c73..097dfe4 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1507,7 +1507,12 @@  void hisi_sas_controller_reset_prepare(struct hisi_hba *hisi_hba)
 	scsi_block_requests(shost);
 	hisi_hba->hw->wait_cmds_complete_timeout(hisi_hba, 100, 5000);
 
-	del_timer_sync(&hisi_hba->timer);
+	/*
+	 * hisi_hba->timer is only used for v1/v2 hw, and check hw->sht
+	 * which is also only used for v1/v2 hw to skip it for v3 hw
+	 */
+	if (hisi_hba->hw->sht)
+		del_timer_sync(&hisi_hba->timer);
 
 	set_bit(HISI_SAS_REJECT_CMD_BIT, &hisi_hba->flags);
 }
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 033298d..7d2a335 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -4935,7 +4935,6 @@  static void hisi_sas_v3_remove(struct pci_dev *pdev)
 	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);