public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mpt3sas: Improvised loop logic
@ 2023-10-20 10:58 Ranjan Kumar
  2023-10-25  2:35 ` Martin K. Petersen
  2023-10-30 15:34 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Ranjan Kumar @ 2023-10-20 10:58 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: sathya.prakash, sreekanth.reddy, Ranjan Kumar, stable

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

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 <ranjan.kumar@broadcom.com>
---
 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;
-- 
2.31.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-30 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-20 10:58 [PATCH] mpt3sas: Improvised loop logic Ranjan Kumar
2023-10-25  2:35 ` Martin K. Petersen
2023-10-30 15:34 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox