From patchwork Mon Jul 24 13:22:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 13324783 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 41AABC001B0 for ; Mon, 24 Jul 2023 13:24:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231300AbjGXNY1 (ORCPT ); Mon, 24 Jul 2023 09:24:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbjGXNYT (ORCPT ); Mon, 24 Jul 2023 09:24:19 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 151401BC7 for ; Mon, 24 Jul 2023 06:24:05 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1bba04b9df3so8480575ad.0 for ; Mon, 24 Jul 2023 06:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1690205045; x=1690809845; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=GpbTjD0yxv686Ebx8A/vi/einFmGUAwE1VLNI0PofI8=; b=DMBePHZ9Rd97OarOmsU5s59KrY0QuDE1E1BDGQmT01mUwPJhpDXl2dBhZhwzVWz09B VaaMV1V9ttRfPVHZAlUrlG4O41T/Cd99JBTM5hJWMwpbLraAxOjQabhTb4073nkxTH6S lZ7g7v/uMJui3VI9ZsqqlEIA5rzzU6SYryc7s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690205045; x=1690809845; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GpbTjD0yxv686Ebx8A/vi/einFmGUAwE1VLNI0PofI8=; b=E+1xNx3hRyj/W2N6h0Z5SH8KpKI069eTC+z90/1lM7+8pacoc7tAFyg9kQ4CUJpwuB 59DEXZ8i4BriW9yWBkLXWWHTznRbBHSa/2l5qQPMC4LR5JZ5njHlxushBv37C56meMDv 4ij+B90EStD/wkryHY3BjSsnQMiTkhbOFO67QqXoI5+up2a3h09YcmsiaPIE26N4LsUp NRDoLaqGsayuSXFCjNkms5deXziyzsOBfzz7BFyf0fdpI1bbegzBndhp+5++tzUDi6GJ gjau8zRok+zz/QoGoRkEE+8Y+FPKCKz4u60WeBW7h2VP4U/HNfHgUGUW/lVA8cvq8uDj p7ow== X-Gm-Message-State: ABy/qLZJS3HEzegl3/5Ehqpr/spb3uMrzyu2gMnpMI63X3GzmqHXXkGa pnmA2ZWwmHYuVmZ9wsakGkDd1wTnLbdY0G8byuvEBIDhyK4j3sgCqMO7aZjaMseQFzZwvWNRM1A XAHgW8lhuaPYiSA3PU2xmYe5t+azoeDuBNcrYp80u60BUU+dB9D4jh+YCTPc45VRPp4AEOq8orV Lu2LNlTh/nJA== X-Google-Smtp-Source: APBJJlEjYK8BVe7zPCo0zELmlC2JBUPAwqod4K+OGctPTY8xAdPn68M4rvZf1nwuW5W97eMMG4b1gw== X-Received: by 2002:a17:902:b7ca:b0:1b6:6bf0:eb8f with SMTP id v10-20020a170902b7ca00b001b66bf0eb8fmr11948774plz.38.1690205044788; Mon, 24 Jul 2023 06:24:04 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id s8-20020a170902ea0800b001b9e0918b0asm8917887plg.169.2023.07.24.06.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 06:24:04 -0700 (PDT) From: Ranjan Kumar To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: rajsekhar.chundru@broadcom.com, sathya.prakash@broadcom.com, sumit.saxena@broadcom.com, chandrakanth.patil@broadcom.com, sreekanth.reddy@broadcom.com, Ranjan Kumar Subject: [PATCH v1 1/6] mpi3mr: Invokes soft reset upon TSU or event ack time out Date: Mon, 24 Jul 2023 18:52:58 +0530 Message-Id: <20230724132303.19470-2-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230724132303.19470-1-ranjan.kumar@broadcom.com> References: <20230724132303.19470-1-ranjan.kumar@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org When a timestamp update or an event acknowledgment command times out, the driver invokes soft reset handler to recover the controller while holding a mutex lock.The soft reset handler also tries to acquire the same mutex to send initialization commands to the controller which leads to a deadlock scenario . To resolve the issue the driver will check the controller status and if it is operational,the driver will issue a diagnostic fault reset and exit out of the command processing function.If the controller is already faulted or asynchronously reset, then the driver will just exit the command processing function. Signed-off-by: Ranjan Kumar --- drivers/scsi/mpi3mr/mpi3mr_fw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 5fa07d6ee5b8..11b78d4a87a0 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -2343,8 +2343,8 @@ static int mpi3mr_sync_timestamp(struct mpi3mr_ioc *mrioc) ioc_err(mrioc, "Issue IOUCTL time_stamp: command timed out\n"); mrioc->init_cmds.is_waiting = 0; if (!(mrioc->init_cmds.state & MPI3MR_CMD_RESET)) - mpi3mr_soft_reset_handler(mrioc, - MPI3MR_RESET_FROM_TSU_TIMEOUT, 1); + mpi3mr_check_rh_fault_ioc(mrioc, + MPI3MR_RESET_FROM_TSU_TIMEOUT); retval = -1; goto out_unlock; } @@ -3359,8 +3359,8 @@ int mpi3mr_process_event_ack(struct mpi3mr_ioc *mrioc, u8 event, if (!(mrioc->init_cmds.state & MPI3MR_CMD_COMPLETE)) { ioc_err(mrioc, "Issue EvtNotify: command timed out\n"); if (!(mrioc->init_cmds.state & MPI3MR_CMD_RESET)) - mpi3mr_soft_reset_handler(mrioc, - MPI3MR_RESET_FROM_EVTACK_TIMEOUT, 1); + mpi3mr_check_rh_fault_ioc(mrioc, + MPI3MR_RESET_FROM_EVTACK_TIMEOUT); retval = -1; goto out_unlock; }