Skip to contentSkip to conversation

scsi: ufs: Give clk scaling min gear a value

PATCH Applied Can Guo 5 participants 6 messages Jan 28, 2021 – Jan 29, 2021 SCSI

lore
Share & tools
lore

Can Guo

author
#0 lore raw

PATCH v2 1/1 scsi: ufs: Give clk scaling min gear a value

The initialization of clk_scaling.min_gear was removed by mistake. This change adds it back, otherwise clock scaling down would fail.

Fixes 4543d9d78227 ("scsi: ufs: Refactor ufshcd_init/exit_clk_scaling/gating()")
---
 drivers/scsi/ufs/ufshcd.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/scsi/ufs/ufshcd.c +3 -0
index 36bcbb3..8ef6796 100644
@@ -1602,6 +1602,9 @@ static void ufshcd_init_clk_scaling(struct ufs_hba *hba)
 	if (!ufshcd_is_clkscaling_supported(hba))
 		return;
 
+	if (!hba->clk_scaling.min_gear)
+		hba->clk_scaling.min_gear = UFS_HS_G1;
+
 	INIT_WORK(&hba->clk_scaling.suspend_work,
 		  ufshcd_clk_scaling_suspend_work);
 	INIT_WORK(&hba->clk_scaling.resume_work,
Signature · 1 line
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Reviewed-by Tested-by on v2 1/1
#2 lore raw
In reply to Can Guo
Quoted 3 lines · Can Guo

The initialization of clk_scaling.min_gear was removed by mistake. This change adds it back, otherwise clock scaling down would fail.

Thanks for the patch Can, it solves the problem I'm seeing!

And perhaps a:

Regards,
Bjorn

Quoted 24 lines
Fixes 4543d9d78227 ("scsi: ufs: Refactor ufshcd_init/exit_clk_scaling/gating()")
---
 drivers/scsi/ufs/ufshcd.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/scsi/ufs/ufshcd.c +3 -0
index 36bcbb3..8ef6796 100644
@@ -1602,6 +1602,9 @@ static void ufshcd_init_clk_scaling(struct ufs_hba *hba)
 	if (!ufshcd_is_clkscaling_supported(hba))
 		return;
 
+	if (!hba->clk_scaling.min_gear)
+		hba->clk_scaling.min_gear = UFS_HS_G1;
+
 	INIT_WORK(&hba->clk_scaling.suspend_work,
 		  ufshcd_clk_scaling_suspend_work);
 	INIT_WORK(&hba->clk_scaling.resume_work,
Signature · 1 line
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
author
#3 lore raw
Quoted 8 lines · Bjorn Andersson
Quoted 3 lines · Can Guo

The initialization of clk_scaling.min_gear was removed by mistake. This change adds it back, otherwise clock scaling down would fail.

Thanks for the patch Can, it solves the problem I'm seeing!

Quoted 8 lines

And perhaps a:

I missed the two lines due to I was not working on the latest scsi code tip - I should have tested it based on commit 29b87e92a216 ("scsi: ufs: Stop hardcoding the scale down gear"), my bad.

Anyways, thanks for the test!

Regards,
Can Guo.

Quoted 28 lines

Regards,
Bjorn

Quoted 25 lines
Fixes 4543d9d78227 ("scsi: ufs: Refactor ufshcd_init/exit_clk_scaling/gating()")
---
 drivers/scsi/ufs/ufshcd.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/scsi/ufs/ufshcd.c +3 -0
index 36bcbb3..8ef6796 100644
@@ -1602,6 +1602,9 @@ static void ufshcd_init_clk_scaling(struct 
 ufs_hba *hba)
 	if (!ufshcd_is_clkscaling_supported(hba))
 		return;
 
+	if (!hba->clk_scaling.min_gear)
+		hba->clk_scaling.min_gear = UFS_HS_G1;
+
 	INIT_WORK(&hba->clk_scaling.suspend_work,
 		  ufshcd_clk_scaling_suspend_work);

INIT_WORK(&hba->clk_scaling.resume_work,
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.

#5 lore raw
In reply to Can Guo

Can,

Quoted 2 lines

The initialization of clk_scaling.min_gear was removed by mistake. This change adds it back, otherwise clock scaling down would fail.

Applied to 5.12/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering