[PATCH] scsi: ufs: ufs-qcom: Add more rates to ufs_qcom_freq_to_gear_speed()

Konrad Dybcio posted 1 patch 9 months, 2 weeks ago
drivers/ufs/host/ufs-qcom.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] scsi: ufs: ufs-qcom: Add more rates to ufs_qcom_freq_to_gear_speed()
Posted by Konrad Dybcio 9 months, 2 weeks ago
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Booting up -next on SDM845 results in a number of warnings like:

ufshc: ufs_qcom_freq_to_gear_speed: Unsupported clock freq : 50000000
ufshc: ufs_qcom_freq_to_gear_speed: Unsupported clock freq : 200000000

Add the rates to the switch statement to make the check happy.

Fixes: c02fe9e222d1 ("scsi: ufs: qcom: Implement the freq_to_gear_speed() vop")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
 drivers/ufs/host/ufs-qcom.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 37887ec684127925e92e01d40f5ea6b8cdb7fc3c..6ddae865b35851b3b9d5bc5fd3720d06be0b2972 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -2104,6 +2104,7 @@ static u32 ufs_qcom_freq_to_gear_speed(struct ufs_hba *hba, unsigned long freq)
 		gear = UFS_HS_G4;
 		break;
 	case 201500000:
+	case 200000000:
 		gear = UFS_HS_G3;
 		break;
 	case 150000000:
@@ -2111,6 +2112,7 @@ static u32 ufs_qcom_freq_to_gear_speed(struct ufs_hba *hba, unsigned long freq)
 		gear = UFS_HS_G2;
 		break;
 	case 75000000:
+	case 50000000:
 	case 37500000:
 		gear = UFS_HS_G1;
 		break;

---
base-commit: 9d9096722447b77662d4237a09909bde7774f22e
change-id: 20250429-topic-ufs_sdm845-16892228f4db

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Re: [PATCH] scsi: ufs: ufs-qcom: Add more rates to ufs_qcom_freq_to_gear_speed()
Posted by Konrad Dybcio 9 months, 2 weeks ago
On 4/29/25 9:46 PM, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> Booting up -next on SDM845 results in a number of warnings like:
> 
> ufshc: ufs_qcom_freq_to_gear_speed: Unsupported clock freq : 50000000
> ufshc: ufs_qcom_freq_to_gear_speed: Unsupported clock freq : 200000000
> 
> Add the rates to the switch statement to make the check happy.
> 
> Fixes: c02fe9e222d1 ("scsi: ufs: qcom: Implement the freq_to_gear_speed() vop")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---

Please ignore, I was informed that the issue exists because we're checking
the frequency of the wrong clock, a fix for which will be posted by another
engineer soon

Konrad