]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: ufs: Skip last hci reset to get valid register values
authorJunwoo Lee <junwoo80.lee@samsung.com>
Tue, 5 Jul 2022 08:35:38 +0000 (17:35 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 7 Jul 2022 21:28:51 +0000 (17:28 -0400)
Once the host link startup fails 3 times, all host registers are reset to
default values except in ufshcd_hba_enable().

The ufs host controller is disabled and enabled in ufshcd_hba_enable().
Consequently we need to skip last hci reset to get valid host register
values.

e.g.
[    1.898026] [2:  kworker/u16:2:  211] ufs: link startup failed 1
[    1.898133] [2:  kworker/u16:2:  211] host_regs: 000000001383ff1f 00000000 00000300 00000000
[    1.898141] [2:  kworker/u16:2:  211] host_regs: 0000001000000106 000001ce 00000000 00000000
[    1.898148] [2:  kworker/u16:2:  211] host_regs: 0000002000000000 00000470 00000000 00000000
[    1.898155] [2:  kworker/u16:2:  211] host_regs: 0000003000000008 00000003 00000000 00000000
[    1.898163] [2:  kworker/u16:2:  211] host_regs: 0000004000000000 00000000 00000000 00000000
[    1.898171] [2:  kworker/u16:2:  211] host_regs: 0000005000000000 00000000 00000000 00000000
[    1.898177] [2:  kworker/u16:2:  211] host_regs: 0000006000000000 00000000 00000000 00000000
[    1.898186] [2:  kworker/u16:2:  211] host_regs: 0000007000000000 00000000 00000000 00000000
[    1.898194] [2:  kworker/u16:2:  211] host_regs: 0000008000000000 00000000 00000000 00000000
[    1.898201] [2:  kworker/u16:2:  211] host_regs: 0000009000000000 00000000 00000000 00000000

Link: https://lore.kernel.org/r/20220705083538.15143-1-sh043.lee@samsung.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Junwoo Lee <junwoo80.lee@samsung.com>
Signed-off-by: Seunghui Lee <sh043.lee@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c

index 7c1d7bb9c579755fcc6db549d08e8b2d53f47024..2cdc146754431ebd8b54e6abac2965eff30b6776 100644 (file)
@@ -4753,7 +4753,7 @@ link_startup:
                 * but we can't be sure if the link is up until link startup
                 * succeeds. So reset the local Uni-Pro and try again.
                 */
-               if (ret && ufshcd_hba_enable(hba)) {
+               if (ret && retries && ufshcd_hba_enable(hba)) {
                        ufshcd_update_evt_hist(hba,
                                               UFS_EVT_LINK_STARTUP_FAIL,
                                               (u32)ret);