Unverified Commit f7f184bb authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!794 scsi: hisi_sas: The IO timeout mechanism and error handling related bugfix

Merge Pull Request from: @xia-bing1 
 
1. Do not frequently enter the I/O exception handling process. Change the timeout interval of the DMA setup and data frame to 2.5s.
2. When multiple I/Os are delivered in the NCQ scenario and one of the I/Os is faulty, the group slow disk problem will occur. Add patch at the hisi_sas layer to ensure consistency between the Linux community and the openEuler solution. 
 
Link:https://gitee.com/openeuler/kernel/pulls/794

 

Reviewed-by: default avatarYihang Li <liyihang9@huawei.com>
Reviewed-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 7420251e c07f6c5d
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#define SATA_INITI_D2H_STORE_ADDR_LO	0x60
#define SATA_INITI_D2H_STORE_ADDR_HI	0x64
#define CFG_MAX_TAG			0x68
#define TRANS_LOCK_ICT_TIME		0X70
#define HGC_SAS_TX_OPEN_FAIL_RETRY_CTRL	0x84
#define HGC_SAS_TXFAIL_RETRY_CTRL	0x88
#define HGC_GET_ITV_TIME		0x90
@@ -427,6 +428,8 @@
#define CMPLT_HDR_DEV_ID_OFF		16
#define CMPLT_HDR_DEV_ID_MSK		(0xffff << CMPLT_HDR_DEV_ID_OFF)
/* dw3 */
#define SATA_DISK_IN_ERROR_STATUS_OFF	8
#define SATA_DISK_IN_ERROR_STATUS_MSK	(0x1 << SATA_DISK_IN_ERROR_STATUS_OFF)
#define CMPLT_HDR_SATA_DISK_ERR_OFF	16
#define CMPLT_HDR_SATA_DISK_ERR_MSK	(0x1 << CMPLT_HDR_SATA_DISK_ERR_OFF)
#define CMPLT_HDR_IO_IN_TARGET_OFF	17
@@ -624,6 +627,8 @@ static void init_reg_v3_hw(struct hisi_hba *hisi_hba)
	hisi_sas_write32(hisi_hba, DLVRY_QUEUE_ENABLE,
			 (u32)((1ULL << hisi_hba->queue_count) - 1));
	hisi_sas_write32(hisi_hba, CFG_MAX_TAG, 0xfff0400);
	/* time / CLK_AHB = 2.5s / 2ns = 0x4A817C80 */
	hisi_sas_write32(hisi_hba, TRANS_LOCK_ICT_TIME, 0x4A817C80);
	hisi_sas_write32(hisi_hba, HGC_SAS_TXFAIL_RETRY_CTRL, 0x108);
	hisi_sas_write32(hisi_hba, CFG_AGING_TIME, 0x1);
	hisi_sas_write32(hisi_hba, INT_COAL_EN, 0x1);
@@ -2238,7 +2243,8 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task,
		} else if (dma_rx_err_type & RX_DATA_LEN_UNDERFLOW_MSK) {
			ts->residual = trans_tx_fail_type;
			ts->stat = SAS_DATA_UNDERRUN;
		} else if (dw3 & CMPLT_HDR_IO_IN_TARGET_MSK) {
		} else if ((dw3 & CMPLT_HDR_IO_IN_TARGET_MSK) ||
			   (dw3 & SATA_DISK_IN_ERROR_STATUS_MSK)) {
			ts->stat = SAS_PHY_DOWN;
			slot->abort = 1;
		} else {
@@ -2964,6 +2970,7 @@ static const struct hisi_sas_debugfs_reg_lu debugfs_global_reg_lu[] = {
	HISI_SAS_DEBUGFS_REG(SATA_INITI_D2H_STORE_ADDR_LO),
	HISI_SAS_DEBUGFS_REG(SATA_INITI_D2H_STORE_ADDR_HI),
	HISI_SAS_DEBUGFS_REG(CFG_MAX_TAG),
	HISI_SAS_DEBUGFS_REG(TRANS_LOCK_ICT_TIME),
	HISI_SAS_DEBUGFS_REG(HGC_SAS_TX_OPEN_FAIL_RETRY_CTRL),
	HISI_SAS_DEBUGFS_REG(HGC_SAS_TXFAIL_RETRY_CTRL),
	HISI_SAS_DEBUGFS_REG(HGC_GET_ITV_TIME),