Re: [PATCH v3 3/8] scsi: ufs: core: Add a vop to map clock frequency to gear speed

From: Ziqi Chen
Date: Thu Feb 06 2025 - 02:49:38 EST




On 2/3/2025 8:55 PM, Bean Huo wrote:
On Mon, 2025-02-03 at 16:11 +0800, Ziqi Chen wrote:
From: Can Guo <quic_cang@xxxxxxxxxxx>

Add a vop to map UFS host controller clock frequencies to the maximum
supported UFS high speed gear speeds.

From the code, seems it is not "maximum" gear, it is corresponding UFS
Gear.


Hi Bean,

Thank you for comment. Let me explain for you that why it is "maximum supported" gear.

For example, the freq 201500000 supports G1 G2 G3, this VOP will maps to G3 which is the "maximum supported" gear.

Maybe we can change it to "corresponding maximum supported" gear would be more make sense.

Let me change it in next version.

-Ziqi

During clock scaling, we canmap thetarget 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@xxxxxxxxxxx>
Signed-off-by: Ziqi Chen <quic_ziqichen@xxxxxxxxxxx>
Signed-off-by: Can Guo <quic_cang@xxxxxxxxxxx>

Reveiwed-by: Bean Huo <beanhuo@xxxxxxxxxx>