[PATCH v1] ufs: core: fix lockdep warning of clk_scaling_lock

Bart Van Assche bvanassche at acm.org
Fri Jul 22 14:00:09 PDT 2022


On 7/22/22 02:53, peter.wang at mediatek.com wrote:
> This patch only release write lock of clk_scaling_lock before
> ufshcd_wb_toggle.

The above is not clear to me. Please make the above more clear.

Additionally, patches must be signed before these can be merged 
upstream. Where is your Signed-off-by?

> -	/* Enable Write Booster if we have scaled up else disable it */
> -	downgrade_write(&hba->clk_scaling_lock);
> -	is_writelock = false;
> -	ufshcd_wb_toggle(hba, scale_up);
> +	wb_toggle = true;
>   
>   out_unprepare:
> -	ufshcd_clock_scaling_unprepare(hba, is_writelock);
> +	ufshcd_clock_scaling_unprepare(hba);
> +
> +	/* Enable Write Booster if we have scaled up else disable it */
> +	if (wb_toggle)
> +		ufshcd_wb_toggle(hba, scale_up);
> +
>   	return ret;
>   }

The patch description should mention that this patch changes the 
ufshcd_wb_toggle() call: before this patch clk_scaling_lock was held in 
reader mode during the ufshcd_wb_toggle() call and with this patch 
applied clk_scaling_lock is not held while ufshcd_wb_toggle() is called. 
I'm missing an explanation of why this change is safe.

Thanks,

Bart.





More information about the Linux-mediatek mailing list