Message ID | 20241107-ufs-clk-fix-v1-1-6032ff22a052@linaro.org |
---|---|
State | New |
Headers | show |
Series | clk: qcom: gcc-{sm8550/sm8650}: Fix UFS resume from suspend issue | expand |
On 07/11/2024 12:58, Manivannan Sadhasivam via B4 Relay wrote: > From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> > > Starting from SM8550, UFS PHY GDSCs doesn't support hardware retention. So > using RETAIN_FF_ENABLE is wrong. Moreover, without ALWAYS_ON flag, GDSCs > will get powered down during suspend, causing the UFS PHY to loose its > state. And this will lead to below UFS error during resume as observed on > SM8550-QRD: > > ufshcd-qcom 1d84000.ufs: ufshcd_uic_hibern8_exit: hibern8 exit failed. ret = 5 > ufshcd-qcom 1d84000.ufs: __ufshcd_wl_resume: hibern8 exit failed 5 > ufs_device_wlun 0:0:0:49488: ufshcd_wl_resume failed: 5 > ufs_device_wlun 0:0:0:49488: PM: dpm_run_callback(): scsi_bus_resume+0x0/0x84 returns 5 > ufs_device_wlun 0:0:0:49488: PM: failed to resume async: error 5 > > Cc: stable@vger.kernel.org # 6.8 > Fixes: 1fe8273c8d40 ("clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag") > Reported-by: Neil Armstrong <neil.armstrong@linaro.org> > Suggested-by: Nitin Rawat <quic_nitirawa@quicinc.com> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> > --- > drivers/clk/qcom/gcc-sm8550.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/clk/qcom/gcc-sm8550.c b/drivers/clk/qcom/gcc-sm8550.c > index 5abaeddd6afc..7dd08e175820 100644 > --- a/drivers/clk/qcom/gcc-sm8550.c > +++ b/drivers/clk/qcom/gcc-sm8550.c > @@ -3046,7 +3046,7 @@ static struct gdsc ufs_phy_gdsc = { > .name = "ufs_phy_gdsc", > }, > .pwrsts = PWRSTS_OFF_ON, > - .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, > + .flags = POLL_CFG_GDSCR | ALWAYS_ON, > }; > > static struct gdsc ufs_mem_phy_gdsc = { > @@ -3055,7 +3055,7 @@ static struct gdsc ufs_mem_phy_gdsc = { > .name = "ufs_mem_phy_gdsc", > }, > .pwrsts = PWRSTS_OFF_ON, > - .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, > + .flags = POLL_CFG_GDSCR | ALWAYS_ON, > }; > > static struct gdsc usb30_prim_gdsc = { > Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-HDK Thanks, Neil
diff --git a/drivers/clk/qcom/gcc-sm8550.c b/drivers/clk/qcom/gcc-sm8550.c index 5abaeddd6afc..7dd08e175820 100644 --- a/drivers/clk/qcom/gcc-sm8550.c +++ b/drivers/clk/qcom/gcc-sm8550.c @@ -3046,7 +3046,7 @@ static struct gdsc ufs_phy_gdsc = { .name = "ufs_phy_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, + .flags = POLL_CFG_GDSCR | ALWAYS_ON, }; static struct gdsc ufs_mem_phy_gdsc = { @@ -3055,7 +3055,7 @@ static struct gdsc ufs_mem_phy_gdsc = { .name = "ufs_mem_phy_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, + .flags = POLL_CFG_GDSCR | ALWAYS_ON, }; static struct gdsc usb30_prim_gdsc = {