Re: [PATCH v5 2/8] scsi: ufs: qcom: Pass target_freq to clk scale pre and post change
From: Peter Wang (王信友)
Date: Fri Feb 14 2025 - 00:54:55 EST
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@xxxxxxxxxxx>
>
> 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@xxxxxxxxxxx>
> Co-developed-by: Ziqi Chen <quic_ziqichen@xxxxxxxxxxx>
> Signed-off-by: Ziqi Chen <quic_ziqichen@xxxxxxxxxxx>
> Reviewed-by: Bean Huo <beanhuo@xxxxxxxxxx>
> Tested-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
> ---
Reviewed-by: Peter Wang <peter.wang@xxxxxxxxxxxx>