Re: [PATCH v3 2/3] scsi: ufs: mediatek: allow clock scaling when ufs_fde is absent

From: Peter Wang

Date: Mon Nov 30 2026 - 06:54:44 EST


On Mon, 2026-11-30 at 10:34 +0000, Ilia Snezhkov via B4 Relay wrote:
> From: Ilia Snezhkov <iasnezhkov@xxxxxxxxx>
>
> ufs_mtk_is_clk_scale_ready() only requires ufs_sel, ufs_sel_max_src,
> and
> ufs_sel_min_src, and _ufs_mtk_clk_scale() already gates FDE clock
> scaling behind clk_fde_scale (mclk->ufs_fde_max_clki &&
> mclk->ufs_fde_min_clki). However, _ufs_mtk_clk_scale() still returns
> early on !fde_clki.
>
> Because of that check, platforms without FDE clock scaling currently
> have to provide dummy ufs_fde entries in DT (pointing ufs_fde_min_src
> and ufs_fde_max_src to the same clock); otherwise
> _ufs_mtk_clk_scale()
> silently becomes a no-op and neither switches ufs_sel nor updates
> dvfsrc-vcore when called from devfreq scaling, suspend/resume, or
> ufs_mtk_fix_clock_scaling().
>
> Only require clki (ufs_sel) in _ufs_mtk_clk_scale(), and gate
> clk_fde_scale on fde_clki being non-NULL alongside its min/max
> parents
> so platforms that do not use FDE scaling can omit the ufs_fde clock
> settings.
>
> Fixes: 5e5976f5242d ("scsi: ufs: host: mediatek: Support FDE (AES)
> clock scaling")
> Signed-off-by: Ilia Snezhkov <iasnezhkov@xxxxxxxxx>
> ---


Reviewed-by: Peter Wang <peter.wang@xxxxxxxxxxxx>