From a5edfb5af66d6d87a79954e60664d85ab3fb7e64 Mon Sep 17 00:00:00 2001 From: Amit Pundir Date: Wed, 8 Feb 2023 20:36:16 +0530 Subject: [PATCH] ANDROID: ufs: core: Fix v5.15.91 merge conflicts in android14-5.15 LTS v5.15.91 commit b03f7ed9af6e ("scsi: ufs: core: Fix devfreq deadlocks") didn't apply cleanly and it led to a probable merge conflict which broke DB845c (sdm845). Bug: 146449535 Fixes: e3d8fe099304 (Merge 5.15.91 into android14-5.15) Change-Id: I308d6425f49e924dad412d5b5a93dc71c1881cbf Signed-off-by: Amit Pundir --- drivers/ufs/core/ufshcd.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index ef631fd08222..7d6dcff1c3d5 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -1316,7 +1316,8 @@ static void ufshcd_clock_scaling_unprepare(struct ufs_hba *hba, bool scale_up) up_write(&hba->clk_scaling_lock); /* Enable Write Booster if we have scaled up else disable it */ - ufshcd_wb_toggle(hba, scale_up); + if (ufshcd_enable_wb_if_scaling_up(hba)) + ufshcd_wb_toggle(hba, scale_up); mutex_unlock(&hba->wb_mutex); @@ -1372,12 +1373,6 @@ static int ufshcd_devfreq_scale(struct ufs_hba *hba, bool scale_up) } } - /* Enable Write Booster if we have scaled up else disable it */ - if (ufshcd_enable_wb_if_scaling_up(hba)) { - downgrade_write(&hba->clk_scaling_lock); - ufshcd_wb_toggle(hba, scale_up); - } - out_unprepare: ufshcd_clock_scaling_unprepare(hba, scale_up); return ret;