diff mbox

[v3,5/8] scsi: hisi_sas: increase timer expire of internal abort task

Message ID 1520261330-204596-6-git-send-email-john.garry@huawei.com (mailing list archive)
State Superseded
Headers show

Commit Message

John Garry March 5, 2018, 2:48 p.m. UTC
From: Xiaofei Tan <tanxiaofei@huawei.com>

The current 110ms expiry time is not long enough for the internal
abort task.

The reason is that the internal abort task could be blocked in HW
if the HW is retrying to set up link. The internal abort task will
be executed only when the retry process finished.

The maximum time is 5s for the retry of setting up link. So, the timer
expire should be more than 5s. This patch increases it from 110ms to 6s.

Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Hannes Reinecke March 6, 2018, 11:23 a.m. UTC | #1
On 03/05/2018 03:48 PM, John Garry wrote:
> From: Xiaofei Tan <tanxiaofei@huawei.com>
> 
> The current 110ms expiry time is not long enough for the internal
> abort task.
> 
> The reason is that the internal abort task could be blocked in HW
> if the HW is retrying to set up link. The internal abort task will
> be executed only when the retry process finished.
> 
Hmm. That sounds weird.
I would have expected that a link retrain will force a device reset,
after which no tasks should be active on the target.
Consequently the succeeding abort task will be a no-op.
Care to clarify?

Cheers,

Hannes
John Garry March 6, 2018, 12:30 p.m. UTC | #2
On 06/03/2018 11:23, Hannes Reinecke wrote:
> On 03/05/2018 03:48 PM, John Garry wrote:
>> From: Xiaofei Tan <tanxiaofei@huawei.com>
>>
>> The current 110ms expiry time is not long enough for the internal
>> abort task.
>>
>> The reason is that the internal abort task could be blocked in HW
>> if the HW is retrying to set up link. The internal abort task will
>> be executed only when the retry process finished.
>>
> Hmm. That sounds weird.
> I would have expected that a link retrain will force a device reset,
> after which no tasks should be active on the target.
> Consequently the succeeding abort task will be a no-op.
> Care to clarify?
>

Hi Hannes,

It sounds like you're talking about TMF task abort, right? This patch is 
related to controller internal abort function.

Our HW supports internal abort, where any pending queued commands in the 
controller can be aborted, so they will not be executed. When a disk is 
removed or a nexus reset are times when we issue such a command.

Thanks very much,
John

> Cheers,
>
> Hannes
>
diff mbox

Patch

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 9d16372..9ff8790 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -871,6 +871,7 @@  static void hisi_sas_tmf_timedout(struct timer_list *t)
 
 #define TASK_TIMEOUT 20
 #define TASK_RETRY 3
+#define INTERNAL_ABORT_TIMEOUT 6
 static int hisi_sas_exec_internal_tmf_task(struct domain_device *device,
 					   void *parameter, u32 para_len,
 					   struct hisi_sas_tmf_task *tmf)
@@ -1574,7 +1575,7 @@  static int hisi_sas_query_task(struct sas_task *task)
 	task->task_proto = device->tproto;
 	task->task_done = hisi_sas_task_done;
 	task->slow_task->timer.function = hisi_sas_tmf_timedout;
-	task->slow_task->timer.expires = jiffies + msecs_to_jiffies(110);
+	task->slow_task->timer.expires = jiffies + INTERNAL_ABORT_TIMEOUT*HZ;
 	add_timer(&task->slow_task->timer);
 
 	res = hisi_sas_internal_abort_task_exec(hisi_hba, sas_dev->device_id,