[PATCH v3 1/2] ufs: core: introduce a choice of wb toggle during clock scaling

Bart Van Assche bvanassche at acm.org
Tue Aug 2 11:44:50 PDT 2022


On 8/2/22 07:32, peter.wang at mediatek.com wrote:
> +	/* Allow WB with clk scaling */

This comment is misleading. Consider changing this comment into 
something like "Enable WB when scaling up the clock and disable WB when 
scaling the clock down".

> +	UFSHCD_CAP_WB_WITH_CLK_SCALING			= 1 << 12,

Whether or not the WriteBooster is toggled when the clock is scaled is 
not a host controller capability. It is a policy that is tied by this 
patch to the host controller. So I think that using the "UFSHCD_CAP_" 
prefix is misleading. Consider using e.g. the prefix UFSHCD_POLICY_.

 > +static inline bool ufshcd_can_wb_during_scaling(struct ufs_hba *hba)
 > +{
 > +	return hba->caps & UFSHCD_CAP_WB_WITH_CLK_SCALING;
 > +}

The name of this function is misleading. Consider renaming this function 
into e.g. ufshcd_enable_wb_if_scaling_up().

Thanks,

Bart.



More information about the Linux-mediatek mailing list