Re: [PATCH v2 3/8] hisi_sas: add internal abort to hisi_sas_abort_task()

2016-08-24 Thread Hannes Reinecke
On 08/24/2016 01:05 PM, John Garry wrote:
> Execute an internal abort for executing a task abort.
> This is for case of the command still being present
> in host when abort is executed.
> 
> For a SATA internal abort, we set abort for all tasks
> associated with the device.
> 
> Signed-off-by: John Garry 
> ---
>  drivers/scsi/hisi_sas/hisi_sas_main.c | 16 ++--
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)


Re: [PATCH v2 3/8] hisi_sas: add internal abort to hisi_sas_abort_task()

2016-08-24 Thread Hannes Reinecke
On 08/24/2016 01:05 PM, John Garry wrote:
> Execute an internal abort for executing a task abort.
> This is for case of the command still being present
> in host when abort is executed.
> 
> For a SATA internal abort, we set abort for all tasks
> associated with the device.
> 
> Signed-off-by: John Garry 
> ---
>  drivers/scsi/hisi_sas/hisi_sas_main.c | 16 ++--
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)


[PATCH v2 3/8] hisi_sas: add internal abort to hisi_sas_abort_task()

2016-08-24 Thread John Garry
Execute an internal abort for executing a task abort.
This is for case of the command still being present
in host when abort is executed.

For a SATA internal abort, we set abort for all tasks
associated with the device.

Signed-off-by: John Garry 
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c 
b/drivers/scsi/hisi_sas/hisi_sas_main.c
index c4e59cd..280a19d 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -841,18 +841,22 @@ static int hisi_sas_abort_task(struct sas_task *task)
}
}
 
+   hisi_sas_internal_task_abort(hisi_hba, device,
+HISI_SAS_INT_ABT_CMD, tag);
} else if (task->task_proto & SAS_PROTOCOL_SATA ||
task->task_proto & SAS_PROTOCOL_STP) {
if (task->dev->dev_type == SAS_SATA_DEV) {
-   struct hisi_slot_info *slot = task->lldd_task;
-
-   dev_notice(dev, "abort task: hba=%p task=%p slot=%p\n",
-  hisi_hba, task, slot);
-   task->task_state_flags |= SAS_TASK_STATE_ABORTED;
+   hisi_sas_internal_task_abort(hisi_hba, device,
+HISI_SAS_INT_ABT_DEV, 0);
rc = TMF_RESP_FUNC_COMPLETE;
-   goto out;
}
+   } else if (task->task_proto & SAS_PROTOCOL_SMP) {
+   /* SMP */
+   struct hisi_sas_slot *slot = task->lldd_task;
+   u32 tag = slot->idx;
 
+   hisi_sas_internal_task_abort(hisi_hba, device,
+HISI_SAS_INT_ABT_CMD, tag);
}
 
 out:
-- 
1.9.1



[PATCH v2 3/8] hisi_sas: add internal abort to hisi_sas_abort_task()

2016-08-24 Thread John Garry
Execute an internal abort for executing a task abort.
This is for case of the command still being present
in host when abort is executed.

For a SATA internal abort, we set abort for all tasks
associated with the device.

Signed-off-by: John Garry 
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c 
b/drivers/scsi/hisi_sas/hisi_sas_main.c
index c4e59cd..280a19d 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -841,18 +841,22 @@ static int hisi_sas_abort_task(struct sas_task *task)
}
}
 
+   hisi_sas_internal_task_abort(hisi_hba, device,
+HISI_SAS_INT_ABT_CMD, tag);
} else if (task->task_proto & SAS_PROTOCOL_SATA ||
task->task_proto & SAS_PROTOCOL_STP) {
if (task->dev->dev_type == SAS_SATA_DEV) {
-   struct hisi_slot_info *slot = task->lldd_task;
-
-   dev_notice(dev, "abort task: hba=%p task=%p slot=%p\n",
-  hisi_hba, task, slot);
-   task->task_state_flags |= SAS_TASK_STATE_ABORTED;
+   hisi_sas_internal_task_abort(hisi_hba, device,
+HISI_SAS_INT_ABT_DEV, 0);
rc = TMF_RESP_FUNC_COMPLETE;
-   goto out;
}
+   } else if (task->task_proto & SAS_PROTOCOL_SMP) {
+   /* SMP */
+   struct hisi_sas_slot *slot = task->lldd_task;
+   u32 tag = slot->idx;
 
+   hisi_sas_internal_task_abort(hisi_hba, device,
+HISI_SAS_INT_ABT_CMD, tag);
}
 
 out:
-- 
1.9.1