Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2475059pxb; Tue, 23 Feb 2021 07:57:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqJBBF0XWRVLtNjqgMCeMWAJGTwMbPfr6WCTre4O21WEOBkrr4XlWW19RLXtjgLPIHHNoP X-Received: by 2002:a17:906:d8c2:: with SMTP id re2mr27142068ejb.146.1614095874388; Tue, 23 Feb 2021 07:57:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614095874; cv=none; d=google.com; s=arc-20160816; b=fBYK5kvWFxwLQeXkdAc3P1SFtMwcKa8Ec6f88LKRBfFPvF8tMpqhNdLl33dTRDvEl1 bF+hVK+BMT7AJKdZEdCwogZVGWfmCAWq7IC0fEOkHVw9PSaOwLooPJFmhhAvFfo7fKG0 VTi+bfpOj37yTRzjHgM++hBp/Ql1EYAPVm3akIlIrGw5ljuO1hQpf/gqn39lql9DuvZv RpWGJE358eAeSz8h7HTDbNB8y/0bRKAcpJKJtQsO9fW/LsmLsJPlRi1TTXaElv8Rod8w BGDWHuQzJJUaPAnuoGgAaYVyN057IHy4APOMcejTcvwXPBmU9Q7AqTCbiCfu6UXxfgda +B3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=FiHmsCtzjqZdswBeWF9nBAqB2aKADHlGWmTe4IilaOw=; b=bkWGfXNhfJRkz/BHsyTxyLn1uDhhKcBog1NvBxIjvJvome0IqmwDY/HOMEqioJuTFl 7swghIZ+bBpmUS0f63ty1IhswQM5TQGwWQ4Rf6jchFVTAWKXRnRzHjKl+7iwPGcH7CBN QsFPQrLhAgTEQJYq5guSJUAgT0YNfUwgAwUkUqBkZH2mN7Qti9JNEfp4qyQzg84Kxe0l 56p5DpDJ5jJJkWAQwqZcTmzCnnpZSFOcUJwMrI3CyjuzLCcX5Vv7JwspmKYhFW3Jl0FH yCLg8nm6bXgepzIOkRuaprrErFlMydssaMQrkqApj91+xz71Q9JUfximwGEg5naLmLb8 uC2g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn21si4825898edb.472.2021.02.23.07.57.26; Tue, 23 Feb 2021 07:57:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232651AbhBWPzL (ORCPT + 99 others); Tue, 23 Feb 2021 10:55:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:42778 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233349AbhBWPzI (ORCPT ); Tue, 23 Feb 2021 10:55:08 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id F057CAC1D; Tue, 23 Feb 2021 15:54:24 +0000 (UTC) Date: Tue, 23 Feb 2021 12:54:22 -0300 From: Enzo Matsumiya To: linux-scsi@vger.kernel.org Cc: Don Brace , "James E.J. Bottomley" , "Martin K. Petersen" , storagedev@microchip.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] scsi: smartpqi: create module parameters for LUN reset Message-ID: <20210223155422.d7x5zm5ozot6dmaq@hyori> References: <20210121170339.11891-1-ematsumiya@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210121170339.11891-1-ematsumiya@suse.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 01/21, Enzo Matsumiya wrote: >Commit c2922f174fa0 ("scsi: smartpqi: fix LUN reset when fw bkgnd thread is hung") >added support for a timeout on LUN resets. > >However, when there are 2 or more devices connected to the same >controller and you hot-remove one of them, I/O will stall on the >devices still online for PQI_LUN_RESET_RETRIES * PQI_LUN_RESET_RETRY_INTERVAL_MSECS >miliseconds. > >This commit makes those values configurable via module parameters. > >Changing the bail out condition on rc in _pqi_device_reset() might be possible, >but could also break the original purpose of commit c2922f174fa0. > >Signed-off-by: Enzo Matsumiya >--- > drivers/scsi/smartpqi/smartpqi_init.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > >diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c >index c53f456fbd09..9835b2e5b91a 100644 >--- a/drivers/scsi/smartpqi/smartpqi_init.c >+++ b/drivers/scsi/smartpqi/smartpqi_init.c >@@ -157,6 +157,18 @@ module_param_named(hide_vsep, > MODULE_PARM_DESC(hide_vsep, > "Hide the virtual SEP for direct attached drives."); > >+static int pqi_lun_reset_retries = 3; >+module_param_named(lun_reset_retries, >+ pqi_lun_reset_retries, int, 0644); >+MODULE_PARM_DESC(lun_reset_retries, >+ "Number of retries when resetting a LUN"); >+ >+static int pqi_lun_reset_tmo_interval = 10000; >+module_param_named(lun_reset_tmo_interval, >+ pqi_lun_reset_tmo_interval, int, 0644); >+MODULE_PARM_DESC(lun_reset_tmo_interval, >+ "LUN reset timeout interval (in miliseconds)"); >+ > static char *raid_levels[] = { > "RAID-0", > "RAID-4", >@@ -5687,8 +5699,6 @@ static int pqi_lun_reset(struct pqi_ctrl_info *ctrl_info, > > /* Performs a reset at the LUN level. */ > >-#define PQI_LUN_RESET_RETRIES 3 >-#define PQI_LUN_RESET_RETRY_INTERVAL_MSECS 10000 > #define PQI_LUN_RESET_PENDING_IO_TIMEOUT_SECS 120 > > static int _pqi_device_reset(struct pqi_ctrl_info *ctrl_info, >@@ -5700,9 +5710,9 @@ static int _pqi_device_reset(struct pqi_ctrl_info *ctrl_info, > > for (retries = 0;;) { > rc = pqi_lun_reset(ctrl_info, device); >- if (rc == 0 || ++retries > PQI_LUN_RESET_RETRIES) >+ if (rc == 0 || ++retries > pqi_lun_reset_retries) > break; >- msleep(PQI_LUN_RESET_RETRY_INTERVAL_MSECS); >+ msleep(pqi_lun_reset_tmo_interval); > } > > timeout_secs = rc ? PQI_LUN_RESET_PENDING_IO_TIMEOUT_SECS : NO_TIMEOUT; >-- >2.30.0 > Can anyone give me some feedback on this please? Cheers, Enzo