Skip to contentSkip to conversation

scsi: core: use eh_timeout to timeout start_unit command

PATCH Applied brookxu 4 participants 5 messages Nov 10, 2021 – Nov 23, 2021 SCSI

lore
Share & tools
lore

brookxu

author
#0 lore raw

PATCH v2 1/1 scsi: core: use eh_timeout to timeout start_unit command

From: Chunguang Xu <[email protected]>

In some abnormal scenarios, STU may timeout. The recovery time of 30 seconds is relatively large. Now we need to modify rq_timeout to adjust STU timeout value, but it will affect the actual IO.

commit 9728c0814ecb ("[SCSI] make scsi_eh_try_stu use block timeout") use rq_timeout to timeout the STU command, but after commit 0816c9251a71 ("[SCSI] Allow error handling timeout to be specified") eh_timeout will init to SCSI_DEFAULT_EH_TIMEOUT, so it is more reasonable to use eh_timeout as the timeout value of STU command. In this way, we can uniformly control recovery time through eh_timeout.

---
v2: Update commit log and fix some format issues.

 drivers/scsi/scsi_error.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/scsi_error.c +2 -1
index a531336..a665318 100644
@@ -1404,7 +1404,8 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
 		enum scsi_disposition rtn = NEEDS_RETRY;
 
 		for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
-			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, scmd->device->request_queue->rq_timeout, 0);
+			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
+						scmd->device->eh_timeout, 0);
 
 		if (rtn == SUCCESS)
 			return 0;
Signature · 1 line
1.8.3.1
Reviewed-by on v2 1/1
#2 lore raw
In reply to brookxu
Quoted 28 lines · brookxu

From: Chunguang Xu <[email protected]>

In some abnormal scenarios, STU may timeout. The recovery time of 30 seconds is relatively large. Now we need to modify rq_timeout to adjust STU timeout value, but it will affect the actual IO.

commit 9728c0814ecb ("[SCSI] make scsi_eh_try_stu use block timeout") use rq_timeout to timeout the STU command, but after commit 0816c9251a71 ("[SCSI] Allow error handling timeout to be specified") eh_timeout will init to SCSI_DEFAULT_EH_TIMEOUT, so it is more reasonable to use eh_timeout as the timeout value of STU command. In this way, we can uniformly control recovery time through eh_timeout.

---
v2: Update commit log and fix some format issues.

  drivers/scsi/scsi_error.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/scsi_error.c +0 -0
index a531336..a665318 100644

drivers/scsi/scsi_error.c static int scsi_eh_try_stu(struct scsi_cmnd *scmd) · line 1411

Quoted 9 lines
drivers/scsi/scsi_error.c +2 -1
@@ -1404,7 +1404,8 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
  		enum scsi_disposition rtn = NEEDS_RETRY;
 
  		for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
-			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, scmd->device->request_queue->rq_timeout, 0);
+			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
+						scmd->device->eh_timeout, 0);
 
  		if (rtn == SUCCESS)
  			return 0;
Signature · 1 line
Wu Bo
#3 lore raw
In reply to brookxu
Quoted 4 lines

In some abnormal scenarios, STU may timeout. The recovery time of 30 seconds is relatively large. Now we need to modify rq_timeout to adjust STU timeout value, but it will affect the actual IO.

Applied to 5.17/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#4 lore raw
In reply to brookxu
Quoted 8 lines · brookxu

From: Chunguang Xu <[email protected]>

In some abnormal scenarios, STU may timeout. The recovery time of 30 seconds is relatively large. Now we need to modify rq_timeout to adjust STU timeout value, but it will affect the actual IO.

[...]

Applied to 5.17/scsi-queue, thanks!

[1/1] scsi: core: use eh_timeout to timeout start_unit command

      https://git.kernel.org/mkp/scsi/c/adcc796b4f55
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering