[PATCH v1] ufs: core: Fix error handler host_sem issue

Bart Van Assche bvanassche at acm.org
Tue Oct 7 09:25:51 PDT 2025


On 10/7/25 12:01 AM, Peter Wang (王信友) wrote:
> No, if we take host_sem before checking pm_op_in_progress,
> it may cause a deadlock. Consider this case:
> 
> ufshcd_wl_suspend
>  down(&hba->host_sem);
>  __ufshcd_wl_suspend => may trigger ufshcd_err_handler
>   ufshcd_execute_start_stop => stuck here waiting for
> ufshcd_err_handler to finish
> 
> ufshcd_err_handler
>  down(&hba->host_sem); => stuck here

Hi Peter,

Please add a comment above the new ufshcd_rpm_get_noresume() call that
explains the above. I think it would be good to have the above
information in the UFS host controller driver source code.

Thanks,

Bart.



More information about the Linux-mediatek mailing list