From patchwork Tue Apr 5 12:06:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 556444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F1F1C433FE for ; Tue, 5 Apr 2022 14:44:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236425AbiDEOq2 (ORCPT ); Tue, 5 Apr 2022 10:46:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381371AbiDEMya (ORCPT ); Tue, 5 Apr 2022 08:54:30 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCDE529C87 for ; Tue, 5 Apr 2022 04:56:21 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id l4-20020a17090a49c400b001c6840df4a3so2436190pjm.0 for ; Tue, 05 Apr 2022 04:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=rB3mfWCJFTHJgC52MHcnxjqxJyvS12JNoVaMNTlk/OI=; b=YloC9xnHxjrIvTeJ6Mq7BsQxSsF9oDbLlAHliuJVpzG9djwQBDb3rr4x3dLq5xOzqJ bQM5/xxy3PM3vKpZSmOuEdYs9mov90WZMsItqLz2E/KMFNE1EhYu5apjheNfVFZgg8gK FrBMX3L3ADlQyHHnoRsTEQbEQp0U3/Z3+1hTo= 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:mime-version; bh=rB3mfWCJFTHJgC52MHcnxjqxJyvS12JNoVaMNTlk/OI=; b=ptOA2zhEbK4tb9+O2E6FnfyojIL0IAhBveiGyA2haIzo9epimooYVRtRrixYVTPZ1N uUe2MKFLe9YstG/4PIlX23V+9C49R3sYo7WAXBU2cb03L0gP4mDStrUGeOtaF4WNq0GZ GqgAVHHUc96t94kkXfxnJVEEkAgmkKhGWTw6HKVYJuYdpt/jqlboUL2earm9Ahl48fdK jNHYWY1tEo5pzY7J+x23wbvsZnxlJuquHioV3m24Udn30VALeBlRzmQLuTmsYMxtDqTJ I2aRer8S4HqZDL45OyZwjzaNiTorVYxDev9q0+Lj2fHO7xOUyCz/Je68do7XmHbPW+HX U/kg== X-Gm-Message-State: AOAM531gTLP7SmMvNecA0NvcngXmbAMlynBNFEPwr8mEKS5PqXyZuxGa 1h8VGf2A7UfoCp22Hpha6qOVt1kZlDK1T40bCw3+dixL/Kk5nS7mGPdkfxiKi7INSTYkuG5Fdt5 KPckOl0/vNMkiVthfuIrZMnPtw7m0wF5HilQrRUqRnPXPQAnpJLTOkMf9imanFcL44Y4/VG/Etx sJ7rHu9BukkaU= X-Google-Smtp-Source: ABdhPJy16Wt0x/Fyl7WhauHFwsHGGDnjKrBLwOv3/m2NCeBWBAO5fi37isw4QiSp5QLUWGOlDv+Rpw== X-Received: by 2002:a17:90b:4c12:b0:1c6:f450:729d with SMTP id na18-20020a17090b4c1200b001c6f450729dmr3774546pjb.190.1649159780939; Tue, 05 Apr 2022 04:56:20 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id f19-20020a056a00229300b004fb157f136asm16143757pfe.153.2022.04.05.04.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 04:56:20 -0700 (PDT) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, Sreekanth Reddy Subject: [PATCH] mpt3sas: Fail reset operation if config request timedout Date: Tue, 5 Apr 2022 17:36:37 +0530 Message-Id: <20220405120637.20528-1-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org As part of controller reset operation, driver issues a config request commands. If this command gets timed out then fail the controller reset operation instead of retrying it. Signed-off-by: Sreekanth Reddy --- 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 0563078..a8dd14c 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; }