]> www.infradead.org Git - nvme.git/commitdiff
scsi: megaraid_sas: Increase register read retry rount from 3 to 30 for selected...
authorChandrakanth patil <chandrakanth.patil@broadcom.com>
Tue, 3 Oct 2023 11:00:18 +0000 (16:30 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 13 Oct 2023 20:51:55 +0000 (16:51 -0400)
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 <chandrakanth.patil@broadcom.com>
Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
Link: https://lore.kernel.org/r/20231003110021.168862-2-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas_base.c

index b9d46dcb521094fa9afc66aa09f7f9e8e73a7b4a..821944a873337ca4e0cc55031edf9199d85bdabf 100644 (file)
@@ -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);