Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp681987pxh; Tue, 9 Nov 2021 17:24:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUXElqGfAfWbsOAW/E9QCc3B4Pn+zeRWaub8EaW20JBs4gM7+YzMwokyRQifqNJjaxLjS9 X-Received: by 2002:a5d:8785:: with SMTP id f5mr8016437ion.110.1636507497124; Tue, 09 Nov 2021 17:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636507497; cv=none; d=google.com; s=arc-20160816; b=ukuEWmKBV+8yXJ0yKp0gt7arFiXO/JvwHDksUoXmTYnHT6Ct2nAHRDkjz8oLXIqCgq bdvnhoSNS1N3ud5iBrLf9aAVq7w7aWF8Fy2frfW+SoLDIxDN4W0Y3HJURqEAuGq5a89L Nwx0CiKvezS6hgsca+12/U9p23lXdlTx7kn+TirxP5nJzpmtfM3JSjHlkxRpWx7BUhjP TdxbZsEkYXEUFhHv7D3h8A4eUuzMC1Vq3nv2lTAuL/zUgiKzv0GFAowanPArXM7M8nFl D3iJZTi+3XXgkRttt/4CO1ucOw3OLFcoAnDmbtYwKHcygRbITTRkyc4DUaZ4hHyUcn42 YVWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=8KsAKNFuVz5kAl4IdR8XgWDYzhLIM4iFKTO/IbBl8jM=; b=dWQPrsFy0xa3sQ34fkExZPqZbnQrvtaGx7nUYFPU2Ym/YM904xEIdPd3V8dyovOlrH XtKcTH9/zgWko+y1K3F1Foi0dy+oTnFzKfPyg/oJ9WYxToVrXjsltEAJX0VYEcTAYgmG iUNH1UShibx3x+WF+ITfP2eRr7zLxKPnJHGZjV0azcq3xQLiWrucf/QgLFdNG//wtufo 43/1spzQGHogSVXQte1JmKlAMZJmUpw3kzfoHDd1MqnJGNZOq95cEYWVAm6U9X31h/cI taAjPk4uxlhBWezTIWRECWyFuACMoLzPamIp1AmzMpFp2ATSW90peRaNtwXeRJiZPFML xMMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=l98xyTbl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si39311246ili.128.2021.11.09.17.24.44; Tue, 09 Nov 2021 17:24:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=l98xyTbl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229526AbhKJB0X (ORCPT + 99 others); Tue, 9 Nov 2021 20:26:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbhKJB0W (ORCPT ); Tue, 9 Nov 2021 20:26:22 -0500 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED495C061764; Tue, 9 Nov 2021 17:23:35 -0800 (PST) Received: by mail-pl1-x62b.google.com with SMTP id u17so1603537plg.9; Tue, 09 Nov 2021 17:23:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=8KsAKNFuVz5kAl4IdR8XgWDYzhLIM4iFKTO/IbBl8jM=; b=l98xyTblDrwgpcixHuBMvmrGHTaL79voaUPmTqScyLLI/yZa576mu8h5IWKZiN4tW0 G2SgpYkx49/m0jwcbWBufXMQwB66Y0naBKvLNLQaqDn0FwLRkGip/d8URMNzhzlwm3Sc 8SUZWKHoiKNepKcAEgG+OtgUViYEn1jvpFYjgeW5faYUZv0m2OEwbJwso6p3lzr+c3b7 zvgEel4IaemLb3Fkp2Mnn6q5RInoWTWU+JLVloBZAW7EXKPRrL59gylEX4AqEl5Ez2yx 0LLzNOmEWdjowAPvvqxRWN20Tq4NVLfOD2w1vt56eES+5e+9lDdEfLltAdWbhf8TI3dL C+BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8KsAKNFuVz5kAl4IdR8XgWDYzhLIM4iFKTO/IbBl8jM=; b=u4FwtD1xS9u4F5PFSasorFm6cw7UYMHiTlFisRd0wJ8ve3hJhKnW0XbkOZeB8GxUsW J+yK1m2xEeza0yogDN/mbbsAvMt9MXKt+XqjCODy7VNMxe4k874Xe0K8OCpEWIg9oufN ZL4dGPVGeC5qjDNqEXEihuEeLcG4b53G9c4oQDFer0NrBAhDfysOIMDxzw10zPqbzj5P SQbtsyI5L/O2t8YnnhIR8caVkHpqnN1vQJYI7HU/bUXGYDke1TDyArQJ0hg8AfxmKKiY Au2k/JokhMdhpfqvt2j7UyTMNx46PcaYNxRpsgJfKSq/UVegATbcT9X3MpjVLbhEDS71 oWRQ== X-Gm-Message-State: AOAM532iaSgUexOj55h+O+CS3YvaOtkWXHp6TonTfqHMMmuShiwuxcfI KEt0EFL9UWD65cSQIRkbBXi6/L9+bXA= X-Received: by 2002:a17:903:18d:b0:142:8ab:d11f with SMTP id z13-20020a170903018d00b0014208abd11fmr11921617plg.47.1636507415443; Tue, 09 Nov 2021 17:23:35 -0800 (PST) Received: from VM-0-3-centos.localdomain ([101.32.213.191]) by smtp.gmail.com with ESMTPSA id j6sm16099210pgq.0.2021.11.09.17.23.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Nov 2021 17:23:35 -0800 (PST) From: brookxu To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: hch@infradead.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command Date: Wed, 10 Nov 2021 09:23:32 +0800 Message-Id: <1636507412-21678-1-git-send-email-brookxu.cn@gmail.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunguang Xu 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. Signed-off-by: Chunguang Xu --- v2: Update commit log and fix some format issues. drivers/scsi/scsi_error.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index a531336..a665318 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -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; -- 1.8.3.1