Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2885092pxb; Mon, 18 Apr 2022 10:15:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAdj+SNgYh4RlhXcOd3x4dskzmtTkbh7hUIRESp4qmdlM531MVlrQqMsLYQZ3u0iBHrk+G X-Received: by 2002:a65:4681:0:b0:382:b4f5:84c2 with SMTP id h1-20020a654681000000b00382b4f584c2mr10992853pgr.218.1650302130758; Mon, 18 Apr 2022 10:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650302130; cv=none; d=google.com; s=arc-20160816; b=ZRc4dPpDIvy+x075eqxUwT3l2oMYjyQnsonsYO1LJxXRJ4gDxVlVXRhjLH7gkvbz2h q46tdpr6h8QWwG5K4cSLFTFqhEofF/wSB5wu5Lmpp5hh4/bqm0GGiS8Fri/Depk3oqgp m2jPQI7NOAbW5SvQaKkHnTqkV4LFq+n4SwigTcANBUcyDR++WmfXoLv7buMg5ArmatbB G1tExwsr3SI0yThQg5Gzgu4ITW6RkSget2uz3HOIFetxGib8ZZbRqfMjDdNqbkzGcUVW UlKlDc5OF6w04RMz4vOlgWfRMbOsRkxRs1co2qTwJrJjv2+3iIbSVMmaU3+Oun+BSAc/ CHEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YHNSj37pbmRFH1DIzGIvaZdP6Fn5Qa6lI7cI28s95bw=; b=SA1Lc4n3rnBp+J+q+VgknJ5oa1tf+yszo64tW498Bif+nMiugx0VDal2DCNyzxo8z7 LwY4UbM8kMNcq10M1+lrmpfvJ6tImZXrfgRkqsnojI9yeu7UmJ0sHGm+bnLge0TdGmtl g4ObprYm5725zeF2EtO7X9XGkUBB/eX/bGUZ74HANcBs6g7wFJi84ZB3sKyS7yfxZIqU wIJtO2xvSJBG5tsuH5Gw+fudht5YMCDMZUsNCC6+TrXLgJ3Kk/9TNNXoy59uFHRKemEK aRlKOsBDK7ds7RcBpdy/M7H9Hx0DJR7U2yWrkvnohM3KFr8VyCaoy+vubgyI4GcKrRvq Uguw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gAyj7lmH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a17090301c300b00153b2d1661csi7780870plh.548.2022.04.18.10.15.13; Mon, 18 Apr 2022 10:15:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gAyj7lmH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237227AbiDRMgd (ORCPT + 99 others); Mon, 18 Apr 2022 08:36:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240193AbiDRM3Y (ORCPT ); Mon, 18 Apr 2022 08:29:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AA8420BE1; Mon, 18 Apr 2022 05:23:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 526FB60FD8; Mon, 18 Apr 2022 12:23:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B69FC385A1; Mon, 18 Apr 2022 12:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284603; bh=dz4DyjCE1hkovpKUeU40FoIrDG+dduM3Lv3sZS9Qj9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gAyj7lmHPYoahm09cYMOSrEP/qFF4rCFGJdF+QEeIdkj9kT9RqT/DvVMuV/TIhueJ Zn+JuQSkZM1bQiQmrl5ob78hBOLXnfqt2npBF/eN/ePwFDJxl+IBMg+/xdjsDhhjjP /Q7MdqhKcairJMqMCwU4fEDe3dK+ofzskZan7KPM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sreekanth Reddy , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.17 167/219] scsi: mpt3sas: Fail reset operation if config request timed out Date: Mon, 18 Apr 2022 14:12:16 +0200 Message-Id: <20220418121211.557252279@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sreekanth Reddy [ Upstream commit f61eb1216c959f93ffabd3b8781fa5b2b22f8907 ] As part of controller reset operation the driver issues a config request command. If this command gets times out, then fail the controller reset operation instead of retrying it. Link: https://lore.kernel.org/r/20220405120637.20528-1-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/mpt3sas/mpt3sas_config.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c index 0563078227de..a8dd14c91efd 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_config.c +++ b/drivers/scsi/mpt3sas/mpt3sas_config.c @@ -394,10 +394,13 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t retry_count++; if (ioc->config_cmds.smid == smid) mpt3sas_base_free_smid(ioc, smid); - if ((ioc->shost_recovery) || (ioc->config_cmds.status & - MPT3_CMD_RESET) || ioc->pci_error_recovery) + if (ioc->config_cmds.status & MPT3_CMD_RESET) goto retry_config; - issue_host_reset = 1; + if (ioc->shost_recovery || ioc->pci_error_recovery) { + issue_host_reset = 0; + r = -EFAULT; + } else + issue_host_reset = 1; goto free_mem; } -- 2.35.1