Commit 779f66a7 authored by Xingui Yang's avatar Xingui Yang Committed by JiangShui
Browse files

scsi: hisi_sas: Handle the NCQ error returned by D2H frame

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8IL6H


CVE: NA

----------------------------------------------------------------------

We find that some disks use D2H frame instead of SDB frame to return NCQ
error. Currently, only the I/O corresponding to the D2H frame is processed
in this scenario, which does not meet the processing requirements of the
NCQ error scenario.
So we set dev_status to HISI_SAS_DEV_NCQ_ERR and abort all I/Os of the disk
in this scenario.

Signed-off-by: default avatarXingui Yang <yangxingui@huawei.com>
Reviewed-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarxiabing <xiabing12@h-partners.com>
parent 3363531b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2239,7 +2239,15 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task,
	case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP:
		if ((dw0 & CMPLT_HDR_RSPNS_XFRD_MSK) &&
		    (sipc_rx_err_type & RX_FIS_STATUS_ERR_MSK)) {
			if (task->ata_task.use_ncq) {
				struct domain_device *device = task->dev;
				struct hisi_sas_device *sas_dev =
						device->lldd_dev;
				sas_dev->dev_status = HISI_SAS_DEV_NCQ_ERR;
				slot->abort = 1;
			} else {
				ts->stat = SAS_PROTO_RESPONSE;
			}
		} else if (dma_rx_err_type & RX_DATA_LEN_UNDERFLOW_MSK) {
			ts->residual = trans_tx_fail_type;
			ts->stat = SAS_DATA_UNDERRUN;