提交 b3eab22d 编写于 作者: X Xingui Yang 提交者: weixin_43408638

scsi: hisi_sas: Handle NCQ error when IPTT is valid

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6NPLN
CVE: NA

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

If an NCQ error occurs when the IPTT is valid and slot->abort flag is set
in completion path, sas_task_abort() will be called to abort only one NCQ
command now, and the host would be set to SHOST_RECOVERY state. But this
may not kick-off EH Immediately until other outstanding QCs timeouts. As a
result, the host may remain in the SHOST_RECOVERY state for up to 30
seconds, such as follows:

[7972317.645234] hisi_sas_v3_hw 0000:74:04.0: erroneous completion iptt=3264 task=00000000466116b8 dev id=2 sas_addr=0x5000000000000502 CQ hdr: 0x1883 0x20cc0 0x40000 0x20420000 Error info: 0x0 0x0 0x200000 0x0
[7972341.508264] sas: Enter sas_scsi_recover_host busy: 32 failed: 32
[7972341.984731] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 32 tries: 1

So all NCQ commands that are in the queue should be aborted when an NCQ
error occurs In this scenario.

Fixes: 05d91b55 ("scsi: hisi_sas: Directly trigger SCSI error handling for completion errors")
Signed-off-by: NXingui Yang <yangxingui@huawei.com>
Reviewed-by: NXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: Nxiabing <xiabing12@h-partners.com>
上级 40ef3ae5
......@@ -1259,7 +1259,11 @@ static void slot_complete_v1_hw(struct hisi_hba *hisi_hba,
slot_err_v1_hw(hisi_hba, task, slot);
if (unlikely(slot->abort)) {
sas_task_abort(task);
if (dev_is_sata(device) && task->ata_task.use_ncq)
sas_ata_device_link_abort(device, true);
else
sas_task_abort(task);
return;
}
goto out;
......
......@@ -2405,7 +2405,11 @@ static void slot_complete_v2_hw(struct hisi_hba *hisi_hba,
error_info[2], error_info[3]);
if (unlikely(slot->abort)) {
sas_task_abort(task);
if (dev_is_sata(device) && task->ata_task.use_ncq)
sas_ata_device_link_abort(device, true);
else
sas_task_abort(task);
return;
}
goto out;
......
......@@ -2318,7 +2318,11 @@ static void slot_complete_v3_hw(struct hisi_hba *hisi_hba,
error_info[0], error_info[1],
error_info[2], error_info[3]);
if (unlikely(slot->abort)) {
sas_task_abort(task);
if (dev_is_sata(device) && task->ata_task.use_ncq)
sas_ata_device_link_abort(device, true);
else
sas_task_abort(task);
return;
}
goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册