You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
scsi: ufs: rockchip: Fix stability issues and add WB support
Disable UFS related clock in runtime is proved to be incorrect and mismatch state between host and device should be recovered by reset the controller to make sure each part is in the beginning status. Meanwhile, we have verified WB works fine by test, so add WB support as well. Change-Id: I5af675576ef2b43ebe5061af204ba1fff5f3f233 Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
This commit is contained in:
@@ -433,14 +433,14 @@ static int ufs_rockchip_rk3576_init(struct ufs_hba *hba)
|
||||
|
||||
/* Enable runtime autosuspend */
|
||||
hba->caps |= UFSHCD_CAP_RPM_AUTOSUSPEND;
|
||||
/* Enable clock-gating */
|
||||
hba->caps |= UFSHCD_CAP_CLK_GATING;
|
||||
/* Enable BKOPS when suspend */
|
||||
hba->caps |= UFSHCD_CAP_AUTO_BKOPS_SUSPEND;
|
||||
/* Enable putting device into deep sleep */
|
||||
hba->caps |= UFSHCD_CAP_DEEPSLEEP;
|
||||
/* Enable devfreq of UFS */
|
||||
hba->caps |= UFSHCD_CAP_CLK_SCALING;
|
||||
/* Enable WriteBooster */
|
||||
hba->caps |= UFSHCD_CAP_WB_EN;
|
||||
|
||||
ret = ufs_rockchip_common_init(hba);
|
||||
if (ret) {
|
||||
@@ -585,6 +585,10 @@ static int ufs_rockchip_runtime_resume(struct device *dev)
|
||||
return err;
|
||||
}
|
||||
|
||||
reset_control_assert(host->rst);
|
||||
udelay(1);
|
||||
reset_control_deassert(host->rst);
|
||||
|
||||
ufs_rockchip_restore_link(hba, false);
|
||||
|
||||
return ufshcd_runtime_resume(dev);
|
||||
|
||||
Reference in New Issue
Block a user