From patchwork Fri Oct 20 10:58:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 13430591 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 010DECDB47E for ; Fri, 20 Oct 2023 11:00:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376909AbjJTLA1 (ORCPT ); Fri, 20 Oct 2023 07:00:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376927AbjJTLAZ (ORCPT ); Fri, 20 Oct 2023 07:00:25 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC0F3114 for ; Fri, 20 Oct 2023 04:00:20 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3b2b1af09c5so472132b6e.0 for ; Fri, 20 Oct 2023 04:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1697799620; x=1698404420; darn=vger.kernel.org; h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=xC2LIDOFRwePUQR3sooU105TAFnQFwkRqZ/6FuJGQaI=; b=ePCVIGrFuCzXTaCOa2kdfd0PCinzEtYJCVK24oUsYItbAAlBEegNyhFsit+Yi6FeBc bH1AZAxtQucXhkqcr5tgPlheP5HjBQ5qOXqxkTC3cRXylsKJnoQX4uhRBlSvn8L5WVAu w1w3C+CuUXguYsfYvoXarOp+PYUDSxfszkEIU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799620; x=1698404420; h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xC2LIDOFRwePUQR3sooU105TAFnQFwkRqZ/6FuJGQaI=; b=Y8W8rqT3klb33I2H0knfb/fAAfCdIAefBDYKlB5Clc2WjDxz2v6tnWdYwgLTgNjm/b 9FiyMLJ6oi2xf96oTiRVAEWTurMZjE3GWPrUyIdNVnNylnyo1OTz780/K372ZV4agmA4 w9AxrsOQdwqxuPAn4Ca6iWnfaN7smk/30+Z7xUacgjHBZHpLjvg+WKT0yIEf7CHihYQg hBdN1gaf6ArDMnWsKyLoAV1zvdhkYqG9jdW6K4LAyuTNcB5Otbe3CkTys8tLYct/1ibf Yv6Y5eH60g7jggJtKPme2+MdeTSbizYu+sZSXfvN8IHi/UXw1VdwZGvA1P0pHS4vyTa9 BwAg== X-Gm-Message-State: AOJu0YzkOuGvZsU7oNCYoMlbX8mj6CnbkqnffRlW1NJiRUQT3YKJdyYK hIEG9fWQwidbUCSKvTMHc9Awy0d+tz2r+0q/cicOZ8HGJtF92wObJ1ydBWjnfxK3op9sO10soE0 NvPjFqSkxtDpZWtIhcXg5PuHOMugyZi3G0C21Lcsy47tnJyPx8NznMJrE3z82Efhql2gKC6r4Xu fKPQKiPan1bg== X-Google-Smtp-Source: AGHT+IGCe5AUTRtXcpDkrgfIjcmZ9aOI8UKt40m3qm3u3QlzGIIPHAKzXQheqa3+U4KAIiYqs3ZZvg== X-Received: by 2002:a05:6808:ca:b0:3a8:3d5b:aad6 with SMTP id t10-20020a05680800ca00b003a83d5baad6mr1489325oic.55.1697799619540; Fri, 20 Oct 2023 04:00:19 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id i186-20020a639dc3000000b0056428865aadsm1188337pgd.82.2023.10.20.04.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 04:00:18 -0700 (PDT) From: Ranjan Kumar To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: sathya.prakash@broadcom.com, sreekanth.reddy@broadcom.com, Ranjan Kumar , stable@vger.kernel.org Subject: [PATCH] mpt3sas: Improvised loop logic Date: Fri, 20 Oct 2023 16:28:49 +0530 Message-Id: <20231020105849.6350-1-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The loop continues to iterate until the count reaches 30, even after receiving the correct value.That is fixed by breaking when non-zero value is read. Fixes: 4ca10f3e3174 ("mpt3sas: Perform additional retries if doorbell read returns 0") Cc: stable@vger.kernel.org Signed-off-by: Ranjan Kumar --- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 61a32bf00747..a75f670bf551 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -223,8 +223,8 @@ _base_readl_ext_retry(const void __iomem *addr) for (i = 0 ; i < 30 ; i++) { ret_val = readl(addr); - if (ret_val == 0) - continue; + if (ret_val != 0) + break; } return ret_val;