mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-19 20:34:20 +08:00
scsi: mpt3sas: Fix loop logic
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: 4ca10f3e31
("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>
This commit is contained in:
parent
44a31659ea
commit
3c978492c3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user