[PATCH v3] scsi: ufs: correct ufshcd_shutdown flow

Bart Van Assche bvanassche at acm.org
Fri Jul 22 14:12:52 PDT 2022


On 7/20/22 23:58, peter.wang at mediatek.com wrote:
> Both ufshcd_shtdown and ufshcd_wl_shutdown could run concurrently.
> And it have race condition when ufshcd_wl_shutdown on-going and
> clock/power turn off by ufshcd_shutdown.
> 
> The normal case:
> ufshcd_wl_shutdown -> ufshcd_shtdown
> ufshcd_shtdown should turn off clock/power.
> 
> The abnormal case:
> ufshcd_shtdown -> ufshcd_wl_shutdown

How can this happen since device_shutdown() iterates over devices in the 
opposite order in which these have been created?

Thanks,

Bart.



More information about the Linux-mediatek mailing list