[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2e692dbf-4a2d-47e0-bf56-af794bf8068c@quicinc.com>
Date: Tue, 6 May 2025 12:10:05 +0800
From: Ziqi Chen <quic_ziqichen@...cinc.com>
To: Avri Altman <Avri.Altman@...disk.com>,
"quic_cang@...cinc.com"
<quic_cang@...cinc.com>,
"bvanassche@....org" <bvanassche@....org>,
"mani@...nel.org" <mani@...nel.org>,
"beanhuo@...ron.com"
<beanhuo@...ron.com>,
"avri.altman@....com" <avri.altman@....com>,
"junwoo80.lee@...sung.com" <junwoo80.lee@...sung.com>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"quic_nguyenb@...cinc.com" <quic_nguyenb@...cinc.com>,
"quic_nitirawa@...cinc.com" <quic_nitirawa@...cinc.com>,
"quic_rampraka@...cinc.com" <quic_rampraka@...cinc.com>,
"neil.armstrong@...aro.org" <neil.armstrong@...aro.org>,
"luca.weiss@...rphone.com" <luca.weiss@...rphone.com>,
"konrad.dybcio@....qualcomm.com" <konrad.dybcio@....qualcomm.com>
CC: "linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"Manivannan
Sadhasivam" <manivannan.sadhasivam@...aro.org>,
"James E.J. Bottomley"
<James.Bottomley@...senPartnership.com>,
open list
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] scsi: ufs: qcom: Check gear against max gear in vop
freq_to_gear()
Hi Avri,
On 5/2/2025 1:10 PM, Avri Altman wrote:
>> The vop freq_to_gear() may return a gear greater than the negotiated max
>> gear, return the negotiated max gear if the mapped gear is greater than it.
>>
>> Tested-by: Neil Armstrong <neil.armstrong@...aro.org>
>> Signed-off-by: Ziqi Chen <quic_ziqichen@...cinc.com>
>> ---
>> drivers/ufs/host/ufs-qcom.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index
>> 46cca52aa6f1..f5ea703d8ef5 100644
>> --- a/drivers/ufs/host/ufs-qcom.c
>> +++ b/drivers/ufs/host/ufs-qcom.c
>> @@ -1938,9 +1938,11 @@ static u32 ufs_qcom_freq_to_gear_speed(struct
>> ufs_hba *hba, unsigned long freq)
>> break;
>> default:
>> dev_err(hba->dev, "%s: Unsupported clock freq : %lu\n",
>> __func__, freq);
>> - break;
>> + return gear;
> Mayby return 0 so it is clear that you are not returning a gear
>
>> }
>>
>> + gear = min_t(u32, gear, hba->max_pwr_info.info.gear_rx);
> return min_t(u32, gear, hba->max_pwr_info.info.gear_rx);
>
Thanks, the way you suggested is more concise. I will update and use
this way.
Ziqi
> Thanks,
> Avri
>> +
>> return gear;
>> }
>>
>> --
>> 2.34.1
>>
>
Powered by blists - more mailing lists