Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: ufs: ufs-exynos: Change ufs phy control sequence

Since commit 1599069a62c6 ("phy: core: Warn when phy_power_on is called
before phy_init"), the following warning has been reported:

phy_power_on was called before phy_init

To address this, we need to remove phy_power_on from exynos_ufs_phy_init()
and move it after phy_init. phy_power_off and phy_exit are also necessary
in exynos_ufs_remove().

Link: https://lore.kernel.org/r/20220706020255.151177-4-chanho61.park@samsung.com
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Chanho Park and committed by
Martin K. Petersen
3d73b200 98211062

+10 -7
+10 -7
drivers/ufs/host/ufs-exynos.c
··· 905 905 if (ret) { 906 906 dev_err(hba->dev, "%s: phy init failed, ret = %d\n", 907 907 __func__, ret); 908 - goto out_exit_phy; 908 + return ret; 909 909 } 910 + 911 + ret = phy_power_on(generic_phy); 912 + if (ret) 913 + goto out_exit_phy; 910 914 911 915 return 0; 912 916 ··· 1173 1169 goto out; 1174 1170 } 1175 1171 1176 - ret = phy_power_on(ufs->phy); 1177 - if (ret) 1178 - goto phy_off; 1179 - 1180 1172 exynos_ufs_priv_init(hba, ufs); 1181 1173 1182 1174 if (ufs->drv_data->drv_init) { ··· 1190 1190 exynos_ufs_config_smu(ufs); 1191 1191 return 0; 1192 1192 1193 - phy_off: 1194 - phy_power_off(ufs->phy); 1195 1193 out: 1196 1194 hba->priv = NULL; 1197 1195 return ret; ··· 1600 1602 static int exynos_ufs_remove(struct platform_device *pdev) 1601 1603 { 1602 1604 struct ufs_hba *hba = platform_get_drvdata(pdev); 1605 + struct exynos_ufs *ufs = ufshcd_get_variant(hba); 1603 1606 1604 1607 pm_runtime_get_sync(&(pdev)->dev); 1605 1608 ufshcd_remove(hba); 1609 + 1610 + phy_power_off(ufs->phy); 1611 + phy_exit(ufs->phy); 1612 + 1606 1613 return 0; 1607 1614 } 1608 1615