From patchwork Wed Jul 12 11:59:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 702162 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 8475CEB64DA for ; Wed, 12 Jul 2023 12:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233342AbjGLMBM (ORCPT ); Wed, 12 Jul 2023 08:01:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232022AbjGLMBE (ORCPT ); Wed, 12 Jul 2023 08:01:04 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B1F51992 for ; Wed, 12 Jul 2023 05:00:55 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-666e5f0d60bso4050301b3a.3 for ; Wed, 12 Jul 2023 05:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1689163255; x=1691755255; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=xP9ESRUMWyDjTm6E5nETSqLajJJmMse6kUN7/ofQSpA=; b=eT+5bbndxWpSHm5/ZsBVMUpa7TgjLfVq1JaOhSQB+NM2paQzAzXJI1NFwn7jaciYG4 K649JAQHP5vUrpLs2brdpluQPOPJvNG3T2NqBsAnFYi+mnaJbrD4rn5N6fsUWdk4M5yK hmGM1IgFQ8aA0r2HsOAp1TYLFEMRouESGRRD4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689163255; x=1691755255; 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=xP9ESRUMWyDjTm6E5nETSqLajJJmMse6kUN7/ofQSpA=; b=W/KNjgLVQESjWIqs+//GPfTWIcfvKyKE5QD6MEc/WTfQG8aOObZvp1SbMNVTmeKH+S inOibMFguoErhOpJwRZveueLNZXNg7cHPsDBGpRzbHiXdBolhiRoK8somomjhJU1B/Ls spfjh/G9UGaAHt3tvqtE80D0SZEKIUZ4eCHmlzT6CYAh83cl1d7imOCrTJpphPIv/Q2n dyX/Qfuh+D8Sd7STKoE8pKOI5URULM5h+fvWaT+DA/34bkfORZCujIbkTEk7D9H/YFoO EIuKiB5EZ83NOz1KincaWxcPAj7v842L8irqmYCifTtIx1BRcno67dKs1UQf+uyUSGi3 C9kQ== X-Gm-Message-State: ABy/qLYQzaeYm1dcebpkLzPdLHSXhWQrz8+Jk3TrKg9NtOUEikPZgn8U Wo4QoKdOjTchNcN319/hldQS1cmOWmm2i3MkOJwbUH/7KMDioFN+qam3f+A88Gs+er5F3Emewq8 I8XXtB2+bYE0uE9sfNM6uS4IJW0FJpajmUl64W3u5PmDgnOKfLrmep2grPqcd9eqUAWQY5p51sj kOYd7EIpLfqw== X-Google-Smtp-Source: APBJJlERLOC80eNgVjybSlLA0DsrintFLilVjuufh8FQPhSjGC/a8BDXJ+i+GwJTnugQENaw+E/ZEg== X-Received: by 2002:a05:6a21:3d82:b0:132:c8da:851d with SMTP id bj2-20020a056a213d8200b00132c8da851dmr1076715pzc.18.1689163254528; Wed, 12 Jul 2023 05:00:54 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id x7-20020a1709029a4700b001b531e8a000sm3799627plv.157.2023.07.12.05.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 05:00:54 -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, sreekanth.reddy@broadcom.com, chandrakanth.patil@broadcom.com, Ranjan Kumar Subject: [PATCH 1/6] mpi3mr: Invokes soft reset upon TSU or event ack time out Date: Wed, 12 Jul 2023 17:29:50 +0530 Message-Id: <20230712115955.6312-2-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230712115955.6312-1-ranjan.kumar@broadcom.com> References: <20230712115955.6312-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; }