From patchwork Tue Oct 3 11:00:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 729627 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 C53A7E7544B for ; Tue, 3 Oct 2023 11:00:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239727AbjJCLAH (ORCPT ); Tue, 3 Oct 2023 07:00:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239721AbjJCLAF (ORCPT ); Tue, 3 Oct 2023 07:00:05 -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 C3CC3B0 for ; Tue, 3 Oct 2023 04:00:00 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1c60778a3bfso5925935ad.1 for ; Tue, 03 Oct 2023 04:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1696330800; x=1696935600; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=PCJjBG2EmioeBWHfRoQl576X1AejGlq+N1hbuWIMVJ4=; b=RHlmlB6ypMHBllHF4Oss054BFIfAlS3xYIIhCZRVJV3zlTl6bpfeMgbZJLMkCxR6zB Z2cXaiR1RHUBHS/WJ2cvDu1Khi1/uxWhKEnnNrira7+LLCejQs6IhSK1Cl3lIgG8FmYE Thh4mDdVmq+xAF3qxudNn6qSpri9tYMFU/f5I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696330800; x=1696935600; 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=PCJjBG2EmioeBWHfRoQl576X1AejGlq+N1hbuWIMVJ4=; b=rqKhokZ2YRoeaqTVIeiARN92KxtfB3sOVssrOq/jwzwAY06NsG1EfCxxxa+QopwvZZ Pf4CNXwUJvVQuyd5s+J/aVK12enxNQHQ4Ipi5jmjsa2daNN9QJRKb32EoGBhwRH1bo7z iGo+wAFyaHmbmoQ5Va24hVjuboP2Ae1OZaexHZQR1KyvenDDWyMIZ6PhxkaTB0iFT5Yy RjQsH4HWUWOX7ISOpifzUhf0lDPhggp5av67bns6mFdl/otI2z33NJ+qNiWjiPqpe5Cg 5NAcg5U85X/FQyW1tYgWl54V8tF+YM5I/20e2ruf/Yee25mqeizmh/wQLrWMCwV4401v CY1w== X-Gm-Message-State: AOJu0Yzw4Qsy4dk6Rrg3B5/36pkwxxoqLtQM+o/C+mZ/mQJV53z08eFs er69651DqGCv4qs3G+LwyGTZSD1vHpBbLsIrmaiQEovtvkFU6Ja4VdKZF3M7PjdX7ekSsLuA+T1 Xx4H1aeYjwLBa/jQKoPEIu6o4SEGdN/40QsKhP3VVEoIfxWMHdNssOPTsAXKGvyMHyIOecreZhx Fn4clpWRE5paAdXRSS2ChQ X-Google-Smtp-Source: AGHT+IHUjH/dr4FxjIBVlmAqJekrdPXAMrWuoFNhrCJZX5LAnAiw5cqz4HQPCqxOXHNaTZfkfsbhfg== X-Received: by 2002:a17:903:428b:b0:1b8:2c6f:3248 with SMTP id ju11-20020a170903428b00b001b82c6f3248mr13995588plb.39.1696330799804; Tue, 03 Oct 2023 03:59:59 -0700 (PDT) Received: from dhcp-10-123-20-35.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id a7-20020a170902ecc700b001bc6e6069a6sm1211909plh.122.2023.10.03.03.59.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 03:59:58 -0700 (PDT) From: Chandrakanth patil To: linux-scsi@vger.kernel.org, sumit.saxena@broadcom.com Cc: Chandrakanth patil , stable@vger.kernel.org Subject: [PATCH 1/4] megaraid_sas: Increase register read retry rount from 3 to 30 for selected registers Date: Tue, 3 Oct 2023 16:30:18 +0530 Message-Id: <20231003110021.168862-2-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231003110021.168862-1-chandrakanth.patil@broadcom.com> References: <20231003110021.168862-1-chandrakanth.patil@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In BMC environments with concurrent access to multiple registers, certain registers occasionally yield a value of 0 even after 3 retries due to hardware errata. As a fix, we have extended the retry count from 3 to 30. The same errata applies to the mpt3sas driver, and a similar patch has been accepted. Please find more details in the mpt3sas patch reference link. Link: https://lore.kernel.org/r/20230829090020.5417-2-ranjan.kumar@broadcom.com Fixes: 272652fcbf1a ("scsi: megaraid_sas: add retry logic in megasas_readl") Cc: stable@vger.kernel.org Signed-off-by: Chandrakanth patil Signed-off-by: Sumit Saxena --- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index e1aa667dae66..3d4f13da1ae8 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -263,13 +263,13 @@ u32 megasas_readl(struct megasas_instance *instance, * Fusion registers could intermittently return all zeroes. * This behavior is transient in nature and subsequent reads will * return valid value. As a workaround in driver, retry readl for - * upto three times until a non-zero value is read. + * up to thirty times until a non-zero value is read. */ if (instance->adapter_type == AERO_SERIES) { do { ret_val = readl(addr); i++; - } while (ret_val == 0 && i < 3); + } while (ret_val == 0 && i < 30); return ret_val; } else { return readl(addr);