Skip to content

Commit

Permalink
scsi: mpt3sas: Fix loop logic
Browse files Browse the repository at this point in the history
commit 3c97849 upstream.

The retry loop continues to iterate until the count reaches 30, even after
receiving the correct value. Exit loop when a non-zero value is read.

Fixes: 4ca10f3 ("scsi: mpt3sas: Perform additional retries if doorbell read returns 0")
Cc: stable@vger.kernel.org
Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
Link: https://lore.kernel.org/r/20231020105849.6350-1-ranjan.kumar@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ranjan Kumar authored and gregkh committed Nov 28, 2023
1 parent 6932724 commit fc3166d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/mpt3sas/mpt3sas_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ _base_readl_ext_retry(const volatile 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;
Expand Down

0 comments on commit fc3166d

Please sign in to comment.