Message ID | 20250213080008.2984807-1-quic_ziqichen@quicinc.com |
---|---|
Headers | show |
Series | Support Multi-frequency scale for UFS | expand |
On Thu, 2025-02-13 at 16:00 +0800, Ziqi Chen wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > > > From: Can Guo <quic_cang@quicinc.com> > > Instead of only two frequencies, if OPP V2 is used, the UFS devfreq > clock > scaling may scale the clock among multiple frequencies. In the case > of > scaling up, the devfreq may decide to scale the clock to an > intermediate > freq based on load, but the clock scale up pre change operation uses > settings for the max clock freq unconditionally. Fix it by passing > the > target_freq to clock scale up pre change so that the correct settings > for > the target_freq can be used. > > In the case of scaling down, the clock scale down post change > operation > is doing fine, because it reads the actual clock rate to tell freq, > but to > keep symmetry with clock scale up pre change operation, just use the > target_freq instead of reading clock rate. > > Signed-off-by: Can Guo <quic_cang@quicinc.com> > Co-developed-by: Ziqi Chen <quic_ziqichen@quicinc.com> > Signed-off-by: Ziqi Chen <quic_ziqichen@quicinc.com> > Reviewed-by: Bean Huo <beanhuo@micron.com> > Tested-by: Neil Armstrong <neil.armstrong@linaro.org> > --- Reviewed-by: Peter Wang <peter.wang@mediatek.com>
On Thu, 2025-02-13 at 16:00 +0800, Ziqi Chen wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > > > From: Can Guo <quic_cang@quicinc.com> > > Add a vop to map UFS host controller clock frequencies to the > corresponding > maximum supported UFS high speed gear speeds. During clock scaling, > we can > map the target clock frequency, demanded by devfreq, to the maximum > supported gear speed, so that devfreq can scale the gear to the > highest > gear speed supported at the target clock frequency, instead of just > scaling > up/down the gear between the min and max gear speeds. > > Co-developed-by: Ziqi Chen <quic_ziqichen@quicinc.com> > Signed-off-by: Ziqi Chen <quic_ziqichen@quicinc.com> > Signed-off-by: Can Guo <quic_cang@quicinc.com> > Reviewed-by: Bean Huo <beanhuo@micron.com> > Reviewed-by: Bart Van Assche <bvanassche@acm.org> > Tested-by: Neil Armstrong <neil.armstrong@linaro.org> > --- > v2 -> v3: > 1. Remove the parameter 'gear' and use it as function return result. > 2. Change "vops" into "vop" in commit message. > > v4 -> v5: > 1. keep the indentation consistent for vop freq_to_gear_speed. > 2. Change the return value type of vop freq_to_gear_speed from 'int' > to 'u32'. > --- > Reviewed-by: Peter Wang <peter.wang@mediatek.com>
On Thu, 2025-02-13 at 16:00 +0800, Ziqi Chen wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > > > From: Can Guo <quic_cang@quicinc.com> > > Implement the freq_to_gear_speed() vop to map the unipro core clock > frequency to the corresponding maximum supported gear speed. > > Signed-off-by: Can Guo <quic_cang@quicinc.com> > Co-developed-by: Ziqi Chen <quic_ziqichen@quicinc.com> > Signed-off-by: Ziqi Chen <quic_ziqichen@quicinc.com> > Reviewed-by: Bean Huo <beanhuo@micron.com> > Tested-by: Neil Armstrong <neil.armstrong@linaro.org> > --- > > v1 -> v2: > Print out freq and gear info as debugging message. > > v2 -> v3: > 1. Change "vops" to "vop" in commit message. > 2. Removed variable 'ret' in function ufs_qcom_freq_to_gear_speed(). > 3. Removed parameters '*gear' and use gear value as return value for > funtion ufs_qcom_freq_to_gear_speed(). > > v3 -> v4: > Change the data type of 'gear' from 'int' to 'u32'. > --- > Reviewed-by: Peter Wang <peter.wang@mediatek.com>