Skip to content

Commit 90b2485

Browse files
Xingui Yangmartinkpetersen
authored andcommitted
scsi: hisi_sas: Update disk locked timeout to 7 seconds
The SATA disk will be locked after the disk sends the DMA Setup frame until all data frame transmission is completed. The CFG_ICT_TIMER_STEP_TRSH register is used for sata disk to configure the step size of the timer which records the time when the disk is locked. The unit is 1us and the default step size is 150ms. If the disk is locked for more than 7 timer steps, the io to be sent to the disk will end abnormally. The current timeout is only about 1 second, it is easy to trigger IO abnormal end when the SATA hard disk returns data slowly. Adjust the timeout to 7 seconds based on ERC time of most disks. Signed-off-by: Xingui Yang <yangxingui@huawei.com> Link: https://lore.kernel.org/r/20241008021822.2617339-10-liyihang9@huawei.com Reviewed-by: Xiang Chen <chenxiang66@hisilicon.com> Reviewed-by: Yihang Li <liyihang9@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent a220bff commit 90b2485

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#define CQ_INT_CONVERGE_EN 0xb0
4444
#define CFG_AGING_TIME 0xbc
4545
#define HGC_DFX_CFG2 0xc0
46+
#define CFG_ICT_TIMER_STEP_TRSH 0xc8
4647
#define CFG_ABT_SET_QUERY_IPTT 0xd4
4748
#define CFG_SET_ABORTED_IPTT_OFF 0
4849
#define CFG_SET_ABORTED_IPTT_MSK (0xfff << CFG_SET_ABORTED_IPTT_OFF)
@@ -638,6 +639,7 @@ static void init_reg_v3_hw(struct hisi_hba *hisi_hba)
638639
hisi_sas_write32(hisi_hba, TRANS_LOCK_ICT_TIME, 0x4A817C80);
639640
hisi_sas_write32(hisi_hba, HGC_SAS_TXFAIL_RETRY_CTRL, 0x108);
640641
hisi_sas_write32(hisi_hba, CFG_AGING_TIME, 0x1);
642+
hisi_sas_write32(hisi_hba, CFG_ICT_TIMER_STEP_TRSH, 0xf4240);
641643
hisi_sas_write32(hisi_hba, INT_COAL_EN, 0x3);
642644
/* configure the interrupt coalescing timeout period 10us */
643645
hisi_sas_write32(hisi_hba, OQ_INT_COAL_TIME, 0xa);

0 commit comments

Comments
 (0)