From patchwork Fri Aug 4 10:42:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 711093 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 9171BC001DF for ; Fri, 4 Aug 2023 10:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231481AbjHDKnz (ORCPT ); Fri, 4 Aug 2023 06:43:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231341AbjHDKnw (ORCPT ); Fri, 4 Aug 2023 06:43:52 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 042F046B5 for ; Fri, 4 Aug 2023 03:43:52 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1bba04b9df3so16715465ad.0 for ; Fri, 04 Aug 2023 03:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1691145831; x=1691750631; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=IFtvNsMNnDpvggU9Kquwlnv5W3VB8ol3IJYhzymI1A0=; b=AsjfNiZwXhYaG2AzlI7hB5VBjCgZ1mgs63FFeeSFh9g2HQFyQaS8iY2/KsxYu/bWYj GyVkLnA5Z4KmXAms19qNgd2jekPvyl42yLXTUlvR9B6cavAkVEN0aE3siV5UNdV2eS3s 7ZKaUorKmJYcSme69CoJW/6zMUeu0yrdCJ1bY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691145831; x=1691750631; 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=IFtvNsMNnDpvggU9Kquwlnv5W3VB8ol3IJYhzymI1A0=; b=MyKtmWG1Ot8Dabn3hqFpYefSDK0xOCeRETQPwNdnJ4JphspaAGHMkXdhSLSXtdzveJ qvVYceJXYfHqZLaGJoaaJ/63pdneE2wi+TSSiiIDorTatG1AhCqtLr6rF7m4lG8exe/B Igk8gmp4gUhIk4E1IkPSQ7TudKUAUNLh7Z70XIcPxcGFktj9iTzKirMZeGG54Wwn+iHw Lj2NWw4SU38PhZL4eZtCD6755s9QcWN5Owm1zfMXiT5Jef2F4u1rla017c/DqdTcoL+Q gELYodJXECPNGLE6Hs3klsRrB+HJbSIwdTTehqxYqQkGJsC/5Vl1B90O6ThxnlTixFWh x1og== X-Gm-Message-State: AOJu0YyJbfJWjanzsLwksWTxBHgKIA6HLgOI03xLwGZ3W/Y7AdKtWr4T pk8UIltUTz0+cDAiXtdJUkrOhK4vF3/yZsgNaRGBho6yDa7wsNB2YyAsMiK+q6l4Neuzabgijmf 5fjhEQZIdafj6h8seAawvMk9dxDhXidWmrEVFSlxAzug36Vu5x8OWxeiuqGDWrG1KtpXG91u/F6 6Qmadr99YzuA== X-Google-Smtp-Source: AGHT+IFTNaoN/pKRgHExVHLMRupyEtj7HpsnePzA5Nj/AkrX1BRJkYzSWnzlVdjbaRvlGSKZ+g0k+A== X-Received: by 2002:a17:902:b482:b0:1bb:7996:b269 with SMTP id y2-20020a170902b48200b001bb7996b269mr1763746plr.19.1691145831106; Fri, 04 Aug 2023 03:43:51 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id jb15-20020a170903258f00b001bb988ac243sm1424463plb.297.2023.08.04.03.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 03:43:50 -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, Ranjan Kumar Subject: [PATCH v3 1/6] mpi3mr: Invokes soft reset upon TSU or event ack time out Date: Fri, 4 Aug 2023 16:12:43 +0530 Message-Id: <20230804104248.118924-2-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230804104248.118924-1-ranjan.kumar@broadcom.com> References: <20230804104248.118924-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; }