From: Luo Jiaxing luojiaxing@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
Currently we call hisi_sas_softreset_ata_disk() in hisi_sas_I_T_nexus_reset().
The hardware linkreset must be executed regardless of whether the softreset is successful or failed.
Signed-off-by: Luo Jiaxing luojiaxing@huawei.com Reviewed-by: Zhu Xiongxiong zhuxiongxiong@huawei.com Signed-off-by: Yang Xingui yangxingui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/scsi/hisi_sas/hisi_sas_main.c | 28 +++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 0128c547e4c8b..902893dfaacc2 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1277,8 +1277,7 @@ static int hisi_sas_exec_internal_tmf_task(struct domain_device *device, /* no error, but return the number of bytes of * underrun */ - dev_warn(dev, "abort tmf: task to dev %016llx " - "resp: 0x%x sts 0x%x underrun\n", + dev_warn(dev, "abort tmf: task to dev %016llx resp: 0x%x sts 0x%x underrun\n", SAS_ADDR(device->sas_addr), task->task_status.resp, task->task_status.stat); @@ -1293,10 +1292,16 @@ static int hisi_sas_exec_internal_tmf_task(struct domain_device *device, break; }
- dev_warn(dev, "abort tmf: task to dev " - "%016llx resp: 0x%x status 0x%x\n", - SAS_ADDR(device->sas_addr), task->task_status.resp, - task->task_status.stat); + if (task->task_status.resp == SAS_TASK_COMPLETE && + task->task_status.stat == SAS_OPEN_REJECT) { + dev_warn(dev, "abort tmf: open reject failed\n"); + res = -EIO; + } else { + dev_warn(dev, "abort tmf: task to dev %016llx resp: 0x%x status 0x%x\n", + SAS_ADDR(device->sas_addr), + task->task_status.resp, + task->task_status.stat); + } sas_free_task(task); task = NULL; } @@ -1839,8 +1844,9 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
if (dev_is_sata(device)) { rc = hisi_sas_softreset_ata_disk(device); - if (rc) - return TMF_RESP_FUNC_FAILED; + if (rc < 0) + dev_err(dev, "I_T nexus reset: softreset failed (%d)\n", + rc); }
rc = hisi_sas_debug_I_T_nexus_reset(device); @@ -2124,10 +2130,8 @@ _hisi_sas_internal_task_abort(struct hisi_hba *hisi_hba, }
exit: - dev_dbg(dev, "internal task abort: task to dev %016llx task=%pK " - "resp: 0x%x sts 0x%x\n", - SAS_ADDR(device->sas_addr), - task, + dev_dbg(dev, "internal task abort: task to dev %016llx task=%pK resp: 0x%x sts 0x%x\n", + SAS_ADDR(device->sas_addr), task, task->task_status.resp, /* 0 is complete, -1 is undelivered */ task->task_status.stat); sas_free_task(task);