Skip to content

Commit 7f05fd9

Browse files
petegriffinmartinkpetersen
authored andcommitted
scsi: ufs: exynos: Ensure consistent phy reference counts
ufshcd_link_startup() can call ufshcd_vops_link_startup_notify() multiple times when retrying. This causes the phy reference count to keep increasing and the phy to not properly re-initialize. If the phy has already been previously powered on, first issue a phy_power_off() and phy_exit(), before re-initializing and powering on again. Signed-off-by: Peter Griffin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: 3d73b20 ("scsi: ufs: ufs-exynos: Change ufs phy control sequence") Cc: [email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent f92bb74 commit 7f05fd9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/ufs/host/ufs-exynos.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,12 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs)
962962
}
963963

964964
phy_set_bus_width(generic_phy, ufs->avail_ln_rx);
965+
966+
if (generic_phy->power_count) {
967+
phy_power_off(generic_phy);
968+
phy_exit(generic_phy);
969+
}
970+
965971
ret = phy_init(generic_phy);
966972
if (ret) {
967973
dev_err(hba->dev, "%s: phy init failed, ret = %d\n",

0 commit comments

Comments
 (0)