diff options
author | Asutosh Das <asutoshd@codeaurora.org> | 2021-09-28 11:06:13 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-09-29 05:33:32 +0200 |
commit | a0cea83332ae2ba4b740a89fc094aba3298825db (patch) | |
tree | 38b15c17db99840e126c5f05fb08a7672da1d124 /drivers/scsi/ufs/ufs-qcom.c | |
parent | scsi: ufs: core: Export hibern8 entry and exit functions (diff) | |
download | linux-a0cea83332ae2ba4b740a89fc094aba3298825db.tar.xz linux-a0cea83332ae2ba4b740a89fc094aba3298825db.zip |
scsi: ufs: ufs-qcom: Enter and exit hibern8 during clock scaling
Qualcomm controller needs to be in hibern8 before scaling clocks. This
change puts the controller in hibern8 state before scaling and brings it
out after scaling of clocks.
Link: https://lore.kernel.org/r/212b7aaf6d834c4a8c682fdac4a59b84013ed573.1632818942.git.nguyenb@codeaurora.org
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs-qcom.c')
-rw-r--r-- | drivers/scsi/ufs/ufs-qcom.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 92d4c61fc9d0..92f5bb4965fa 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -1212,24 +1212,34 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, int err = 0; if (status == PRE_CHANGE) { + err = ufshcd_uic_hibern8_enter(hba); + if (err) + return err; if (scale_up) err = ufs_qcom_clk_scale_up_pre_change(hba); else err = ufs_qcom_clk_scale_down_pre_change(hba); + if (err) + ufshcd_uic_hibern8_exit(hba); + } else { if (scale_up) err = ufs_qcom_clk_scale_up_post_change(hba); else err = ufs_qcom_clk_scale_down_post_change(hba); - if (err || !dev_req_params) + + if (err || !dev_req_params) { + ufshcd_uic_hibern8_exit(hba); goto out; + } ufs_qcom_cfg_timers(hba, dev_req_params->gear_rx, dev_req_params->pwr_rx, dev_req_params->hs_rate, false); + ufshcd_uic_hibern8_exit(hba); } out: |