From 4ffde482213ed77ea8743d1fb3eccad6e14b151b Mon Sep 17 00:00:00 2001 From: John Garry Date: Wed, 24 Aug 2016 19:05:53 +0800 Subject: [PATCH] scsi: hisi_sas: add TMF success check When a tmf is issued, various response codes can be returned from the target. For a query tmf the response may be TMF_RESP_FUNC_COMPLETE or TMF_RESP_FUNC_SUCC. Add a condition for TMF_RESP_FUNC_SUCC to hisi_sas_exec_internal_tmf_task(). This affects query tmf, as the result is success the returned value was for failure. Signed-off-by: John Garry Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen --- drivers/scsi/hisi_sas/hisi_sas_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 73f581f7dc36..85c73d311e4d 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -743,6 +743,12 @@ static int hisi_sas_exec_internal_tmf_task(struct domain_device *device, break; } + if (task->task_status.resp == SAS_TASK_COMPLETE && + task->task_status.stat == TMF_RESP_FUNC_SUCC) { + res = TMF_RESP_FUNC_SUCC; + break; + } + if (task->task_status.resp == SAS_TASK_COMPLETE && task->task_status.stat == SAS_DATA_UNDERRUN) { /* no error, but return the number of bytes of -- GitLab