diff --git a/arch/arm64/boot/dts/exynos/google/zumapro.dtsi b/arch/arm64/boot/dts/exynos/google/zumapro.dtsi index f8be1721dd..671580dbde 100644 --- a/arch/arm64/boot/dts/exynos/google/zumapro.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zumapro.dtsi @@ -1232,8 +1232,9 @@ phys = <&ufs_phy>; phy-names = "ufs-phy"; samsung,sysreg = <&sysreg_ufs 0x710>; - pinctrl-names = "default"; + pinctrl-names = "default", "sleep"; pinctrl-0 = <&ufs_reset>, <&ufs_refclk>; + pinctrl-1 = <&ufs_reset>, <&ufs_refclk>; lanes-per-direction = <2>; dma-coherent; status = "disabled"; diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 4eadca2fe3..49d0ce212a 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -1886,8 +1887,10 @@ static int exynos_ufs_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op, if (ufs->drv_data->suspend) ufs->drv_data->suspend(ufs); - if (!ufshcd_is_link_active(hba)) + if (!ufshcd_is_link_active(hba)) { phy_power_off(ufs->phy); + pinctrl_pm_select_sleep_state(hba->dev); + } return 0; } @@ -1896,8 +1899,19 @@ static int exynos_ufs_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) { struct exynos_ufs *ufs = ufshcd_get_variant(hba); - if (!ufshcd_is_link_active(hba)) + if (!ufshcd_is_link_active(hba)) { + /* + * On zumapro the UFS pads (the device's reference clock and + * reset) came back from a system suspend as plain inputs on + * about one wake in a hundred, and the host then saw no device + * however often it reset it. Select the pin state again now + * that the link is down and the host's clocks are on (at + * rpm_lvl 3 this runs on every runtime resume too); the + * "sleep" state exists so the default is really written again. + */ + pinctrl_pm_select_default_state(hba->dev); phy_power_on(ufs->phy); + } exynos_ufs_config_smu(ufs); exynos_ufs_fmp_resume(hba);