From patchwork Thu Mar 14 21:57:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10853733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 955B513B5 for ; Thu, 14 Mar 2019 21:57:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C87B2A770 for ; Thu, 14 Mar 2019 21:57:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70DED2A791; Thu, 14 Mar 2019 21:57:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B3402A770 for ; Thu, 14 Mar 2019 21:57:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbfCNV56 (ORCPT ); Thu, 14 Mar 2019 17:57:58 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:48879 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbfCNV56 (ORCPT ); Thu, 14 Mar 2019 17:57:58 -0400 X-IronPort-AV: E=Sophos;i="5.58,479,1544511600"; d="scan'208";a="27831570" Received: from unknown (HELO smtp.microsemi.com) ([208.19.99.222]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Mar 2019 14:57:51 -0700 Received: from AUSMBX3.microsemi.net (10.201.34.33) by AUSMBX2.microsemi.net (10.201.34.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1531.3; Thu, 14 Mar 2019 16:57:50 -0500 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX3.microsemi.net (10.201.34.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1531.3; Thu, 14 Mar 2019 16:57:50 -0500 Received: from [127.0.1.1] (10.238.32.34) by ausmbx2.microsemi.net (10.201.34.32) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Thu, 14 Mar 2019 16:57:49 -0500 Subject: [PATCH 1/5] smartpqi: increase LUN reset timeout From: Don Brace To: , , , , , , , , , , , CC: Date: Thu, 14 Mar 2019 16:57:49 -0500 Message-ID: <155260066986.22781.1718064820896429189.stgit@brunhilda> In-Reply-To: <155260062866.22781.9086128010037157326.stgit@brunhilda> References: <155260062866.22781.9086128010037157326.stgit@brunhilda> User-Agent: StGit/0.19 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kevin Barnett Reviewed-by: Scott Benesh Reviewed-by: David Carroll Reviewed-by: Kevin Barnett Signed-off-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 5d9ccbab7581..90ce0f3097a0 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -5654,9 +5654,11 @@ static int pqi_lun_reset(struct pqi_ctrl_info *ctrl_info, return rc; } +/* Performs a reset at the LUN level. */ + #define PQI_LUN_RESET_RETRIES 3 #define PQI_LUN_RESET_RETRY_INTERVAL_MSECS 10000 -/* Performs a reset at the LUN level. */ +#define PQI_LUN_RESET_PENDING_IO_TIMEOUT_SECS 120 static int _pqi_device_reset(struct pqi_ctrl_info *ctrl_info, struct pqi_scsi_dev *device) @@ -5667,12 +5669,12 @@ static int _pqi_device_reset(struct pqi_ctrl_info *ctrl_info, for (retries = 0;;) { rc = pqi_lun_reset(ctrl_info, device); - if (rc != -EAGAIN || - ++retries > PQI_LUN_RESET_RETRIES) + if (rc != -EAGAIN || ++retries > PQI_LUN_RESET_RETRIES) break; msleep(PQI_LUN_RESET_RETRY_INTERVAL_MSECS); } - timeout_secs = rc ? PQI_LUN_RESET_TIMEOUT_SECS : NO_TIMEOUT; + + timeout_secs = rc ? PQI_LUN_RESET_PENDING_IO_TIMEOUT_SECS : NO_TIMEOUT; rc |= pqi_device_wait_for_pending_io(ctrl_info, device, timeout_secs); @@ -5701,6 +5703,7 @@ static int pqi_device_reset(struct pqi_ctrl_info *ctrl_info, pqi_device_reset_done(device); mutex_unlock(&ctrl_info->lun_reset_mutex); + return rc; } @@ -5731,6 +5734,7 @@ static int pqi_eh_device_reset_handler(struct scsi_cmnd *scmd) pqi_wait_until_ofa_finished(ctrl_info); rc = pqi_device_reset(ctrl_info, device); + out: dev_err(&ctrl_info->pci_dev->dev, "reset of scsi %d:%d:%d:%d: %s\n",