]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: ufs: core: Exclude UECxx from SFR dump list
authorKiwoong Kim <kwmad.kim@samsung.com>
Thu, 31 Mar 2022 01:24:05 +0000 (10:24 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Apr 2022 12:29:54 +0000 (08:29 -0400)
Some devices may return invalid or zeroed data during an UIC error
condition. In addition, reading these SFRs will clear them. This means the
subsequent error handling will not be able to see them and therefore no
error handling will be scheduled.

Skip reading these SFRs in ufshcd_dump_regs().

Link: https://lore.kernel.org/r/1648689845-33521-1-git-send-email-kwmad.kim@samsung.com
Fixes: adcbce1749bd ("scsi: ufs: Use explicit access size in ufshcd_dump_regs")
Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c

index 1b87f26b51933272a93dc4a002ec12523666af27..f4a3326a4803f9e79698d622c6cc3aa09d4ecb70 100644 (file)
@@ -122,8 +122,13 @@ int ufshcd_dump_regs(struct ufs_hba *hba, size_t offset, size_t len,
        if (!regs)
                return -ENOMEM;
 
-       for (pos = 0; pos < len; pos += 4)
+       for (pos = 0; pos < len; pos += 4) {
+               if (offset == 0 &&
+                   pos >= REG_UIC_ERROR_CODE_PHY_ADAPTER_LAYER &&
+                   pos <= REG_UIC_ERROR_CODE_DME)
+                       continue;
                regs[pos / 4] = ufshcd_readl(hba, offset + pos);
+       }
 
        ufshcd_hex_dump(prefix, regs, len);
        kfree(regs);