From: Ziqi Chen <quic_ziqichen@quicinc.com>
To: Avri Altman <Avri.Altman@sandisk.com>,
"quic_cang@quicinc.com" <quic_cang@quicinc.com>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"mani@kernel.org" <mani@kernel.org>,
"beanhuo@micron.com" <beanhuo@micron.com>,
"avri.altman@wdc.com" <avri.altman@wdc.com>,
"junwoo80.lee@samsung.com" <junwoo80.lee@samsung.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"quic_nguyenb@quicinc.com" <quic_nguyenb@quicinc.com>,
"quic_nitirawa@quicinc.com" <quic_nitirawa@quicinc.com>,
"quic_rampraka@quicinc.com" <quic_rampraka@quicinc.com>,
"neil.armstrong@linaro.org" <neil.armstrong@linaro.org>,
"luca.weiss@fairphone.com" <luca.weiss@fairphone.com>,
"konrad.dybcio@oss.qualcomm.com" <konrad.dybcio@oss.qualcomm.com>
Cc: "linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] scsi: ufs: qcom: Check gear against max gear in vop freq_to_gear()
Date: Tue, 6 May 2025 12:10:05 +0800 [thread overview]
Message-ID: <2e692dbf-4a2d-47e0-bf56-af794bf8068c@quicinc.com> (raw)
In-Reply-To: <PH7PR16MB6196FCFC818B623C946BD5DAE58D2@PH7PR16MB6196.namprd16.prod.outlook.com>
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@linaro.org>
>> Signed-off-by: Ziqi Chen <quic_ziqichen@quicinc.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
>>
>
next prev parent reply other threads:[~2025-05-06 4:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250502042432.88434-1-quic_ziqichen@quicinc.com>
2025-05-02 4:24 ` Ziqi Chen
2025-05-02 5:10 ` Avri Altman
2025-05-06 4:10 ` Ziqi Chen [this message]
2025-05-02 4:24 ` [PATCH 2/3] scsi: ufs: qcom: Map devfreq OPP freq to UniPro Core Clock freq Ziqi Chen
2025-05-02 5:13 ` Avri Altman
2025-05-06 4:07 ` Ziqi Chen
2025-05-02 4:24 ` [PATCH 3/3] scsi: ufs: qcom: Call ufs_qcom_cfg_timers() in clock scaling path Ziqi Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e692dbf-4a2d-47e0-bf56-af794bf8068c@quicinc.com \
--to=quic_ziqichen@quicinc.com \
--cc=Avri.Altman@sandisk.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=junwoo80.lee@samsung.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=luca.weiss@fairphone.com \
--cc=mani@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=martin.petersen@oracle.com \
--cc=neil.armstrong@linaro.org \
--cc=quic_cang@quicinc.com \
--cc=quic_nguyenb@quicinc.com \
--cc=quic_nitirawa@quicinc.com \
--cc=quic_rampraka@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®