From patchwork Mon Dec 20 14:11:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 526254 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 CC55CC433EF for ; Mon, 20 Dec 2021 14:04:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233422AbhLTOEJ (ORCPT ); Mon, 20 Dec 2021 09:04:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233434AbhLTOEJ (ORCPT ); Mon, 20 Dec 2021 09:04:09 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA739C06173E for ; Mon, 20 Dec 2021 06:04:08 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id t19so2500090pfg.9 for ; Mon, 20 Dec 2021 06:04:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=mlSbVmUwv/P1PUYulzRkPSeWe8nDbEA3qxvd5sKzOk0=; b=TXxKiH8+mCJgqgnBUYmPHNNNu3G5HThYMieGsO49AmyZs7tG6grWaGMb68XxsMs0sg wAIuNxBEUM4bNHb+nYCDFzKV7QFbFqcEjCK5tkcs/7cyEy9W01rmCWEqEOtoBmwwp4BQ xD7Eh6ou+U09EhJ/+GeLc3vZ+E4XSoy5WLids= 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:in-reply-to :references:mime-version; bh=mlSbVmUwv/P1PUYulzRkPSeWe8nDbEA3qxvd5sKzOk0=; b=EaDTI0B2rKW3HhHvjccTy8NSjctqwWHVuCeSk6Aj3Xx/zBFtHsUM45CZ3ROSQ8rcET 6mE0NdKjHRbGGum0gp/01RgEAxW7rrnv/qypbB2zIWFbjqyjSvtBm0AnwszVi3YfHVgV gVkIsaGhgG/bv9wdrs8csJay4WruLoWKkQc6V9Dq2PdLED2oAFy/m3bmfjRW5JkjDZIH utlCy/DTQ6e7qzbqnveA6qQn5xjYpB8h3QQEru2DVwiz7BHzvWvLChz10n6RHB4owgjX rW7t29ZJNl2CEhtEUqQBneZObOJfJWLh8QZx2cqlf5+ECJhdD0a3HZd5isa31KyTSFl3 Y3Jw== X-Gm-Message-State: AOAM531Y6s8PlCDMjXxeQfQ4pM7ZhlNQdqQLLM5+vfX77LbipW0ZhO60 50WU3teZMe+OhKFY8qiSUHYCU3el5y6wgRcQ0OZbOHlyD/Ws9sEpi84zkJ9W/7khaFWLAMBHWXW qiAuFQ9Bzza4SmZaHmKT9xAaEnFQgdYIgtiF3jlx09H9c7kEqLqv9/imK0j1Ap2liD6XRfWxlxp qOgViggGsM X-Google-Smtp-Source: ABdhPJzrerjnxOTOliPdvSTEPVVbcBmEfVhq9+XuP2bOtuD4p54bu9YsyxVesoEYeNbHBDmcikHKfQ== X-Received: by 2002:a63:dc0b:: with SMTP id s11mr15141254pgg.272.1640009047845; Mon, 20 Dec 2021 06:04:07 -0800 (PST) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b4sm5434180pjm.17.2021.12.20.06.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 06:04:07 -0800 (PST) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, mpi3mr-linuxdrv.pdl@broadcom.com, Sreekanth Reddy Subject: [PATCH 03/25] mpi3mr: Don't reset IOC if cmnds flush with reset status Date: Mon, 20 Dec 2021 19:41:37 +0530 Message-Id: <20211220141159.16117-4-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211220141159.16117-1-sreekanth.reddy@broadcom.com> References: <20211220141159.16117-1-sreekanth.reddy@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Don't issue the soft reset if internal commands are flushed out with reset status. Soft reset needs to be issued only if commands are really timed out. Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpi3mr/mpi3mr_fw.c | 10 ++++++---- drivers/scsi/mpi3mr/mpi3mr_os.c | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 61dcacd..4ce79d7 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -1947,8 +1947,9 @@ static int mpi3mr_sync_timestamp(struct mpi3mr_ioc *mrioc) if (!(mrioc->init_cmds.state & MPI3MR_CMD_COMPLETE)) { ioc_err(mrioc, "Issue IOUCTL time_stamp: command timed out\n"); mrioc->init_cmds.is_waiting = 0; - mpi3mr_soft_reset_handler(mrioc, - MPI3MR_RESET_FROM_TSU_TIMEOUT, 1); + if (!(mrioc->init_cmds.state & MPI3MR_CMD_RESET)) + mpi3mr_soft_reset_handler(mrioc, + MPI3MR_RESET_FROM_TSU_TIMEOUT, 1); retval = -1; goto out_unlock; } @@ -2827,8 +2828,9 @@ int mpi3mr_send_event_ack(struct mpi3mr_ioc *mrioc, u8 event, (MPI3MR_INTADMCMD_TIMEOUT * HZ)); if (!(mrioc->init_cmds.state & MPI3MR_CMD_COMPLETE)) { ioc_err(mrioc, "Issue EvtNotify: command timed out\n"); - mpi3mr_soft_reset_handler(mrioc, - MPI3MR_RESET_FROM_EVTACK_TIMEOUT, 1); + if (!(mrioc->init_cmds.state & MPI3MR_CMD_RESET)) + mpi3mr_soft_reset_handler(mrioc, + MPI3MR_RESET_FROM_EVTACK_TIMEOUT, 1); retval = -1; goto out_unlock; } diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index fe10f25..ce75503 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -2659,8 +2659,9 @@ static int mpi3mr_issue_tm(struct mpi3mr_ioc *mrioc, u8 tm_type, ioc_err(mrioc, "%s :Issue TM: command timed out\n", __func__); drv_cmd->is_waiting = 0; retval = -1; - mpi3mr_soft_reset_handler(mrioc, - MPI3MR_RESET_FROM_TM_TIMEOUT, 1); + if (!(drv_cmd->state & MPI3MR_CMD_RESET)) + mpi3mr_soft_reset_handler(mrioc, + MPI3MR_RESET_FROM_TM_TIMEOUT, 1); goto out_unlock; }