Skip to content

Commit f9242f1

Browse files
Xiang Chenmartinkpetersen
authored andcommitted
scsi: hisi_sas: Remove hisi_hba->timer for v3 hw
hisi_hba->timer is not used for v3 hw but there are two places that some operations related to hisi_hba->timer are called by v3 hw: - Deleting the timer in function hisi_sas_v3_hw() which is only for v3 hw; - Deleting the timer in function hisi_sas_controller_reset_prepare() which is common for v1/v2/v3 hw. We can remove the timer in the first case, but for the second scenario 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> Link: https://lore.kernel.org/r/1705904747-62186-5-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 69097a6 commit f9242f1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,12 @@ void hisi_sas_controller_reset_prepare(struct hisi_hba *hisi_hba)
15071507
scsi_block_requests(shost);
15081508
hisi_hba->hw->wait_cmds_complete_timeout(hisi_hba, 100, 5000);
15091509

1510-
del_timer_sync(&hisi_hba->timer);
1510+
/*
1511+
* hisi_hba->timer is only used for v1/v2 hw, and check hw->sht
1512+
* which is also only used for v1/v2 hw to skip it for v3 hw
1513+
*/
1514+
if (hisi_hba->hw->sht)
1515+
del_timer_sync(&hisi_hba->timer);
15111516

15121517
set_bit(HISI_SAS_REJECT_CMD_BIT, &hisi_hba->flags);
15131518
}

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4935,7 +4935,6 @@ static void hisi_sas_v3_remove(struct pci_dev *pdev)
49354935
struct Scsi_Host *shost = sha->shost;
49364936

49374937
pm_runtime_get_noresume(dev);
4938-
del_timer_sync(&hisi_hba->timer);
49394938

49404939
sas_unregister_ha(sha);
49414940
flush_workqueue(hisi_hba->wq);

0 commit comments

Comments
 (0)