Skip to content

Commit 358e919

Browse files
Xiang Chenmartinkpetersen
authored andcommitted
scsi: hisi_sas: Handle the NCQ error returned by D2H frame
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. Co-developed-by: Xingui Yang <[email protected]> Signed-off-by: Xingui Yang <[email protected]> Signed-off-by: Xiang Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 97a54ef commit 358e919

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2244,7 +2244,15 @@ slot_err_v3_hw(struct hisi_hba *hisi_hba, struct sas_task *task,
22442244
case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP:
22452245
if ((dw0 & CMPLT_HDR_RSPNS_XFRD_MSK) &&
22462246
(sipc_rx_err_type & RX_FIS_STATUS_ERR_MSK)) {
2247-
ts->stat = SAS_PROTO_RESPONSE;
2247+
if (task->ata_task.use_ncq) {
2248+
struct domain_device *device = task->dev;
2249+
struct hisi_sas_device *sas_dev = device->lldd_dev;
2250+
2251+
sas_dev->dev_status = HISI_SAS_DEV_NCQ_ERR;
2252+
slot->abort = 1;
2253+
} else {
2254+
ts->stat = SAS_PROTO_RESPONSE;
2255+
}
22482256
} else if (dma_rx_err_type & RX_DATA_LEN_UNDERFLOW_MSK) {
22492257
ts->residual = trans_tx_fail_type;
22502258
ts->stat = SAS_DATA_UNDERRUN;

0 commit comments

Comments
 (0)