[PATCH v1] ufs: core: Fix runtime suspend error deadlock

Peter Wang (王信友) peter.wang at mediatek.com
Thu Sep 25 03:03:21 PDT 2025


On Wed, 2025-09-24 at 14:51 -0700, Bart Van Assche wrote:
> 
> Hi Peter,
> 
> The UFS error handler is not only triggered by bus errors. It can
> also
> be activated via debugfs. Do you agree that activation via debugfs
> can
> happen concurrently with runtime suspend?
> 
> Thanks,
> 
> Bart.


Hi Bart,

Do you mean that debugfs could schedule EH work just before
suspend? If so, there is indeed a chance that this patch 
might not work as intended. Even if we surround it with 
ufshcd_rpm_get_noresume() and ufshcd_rpm_put(), there is 
still a possibility that runtime PM is ongoing and the suspend
callback hasn't been called yet, so the result would be the 
same, just with a lower chance of occurrence.

Because this patch mainly targets errors that occur during
the suspend process. If the error happens before suspend, 
it’s outside the scope of what this patch is intended to fix. 
But I will add ufshcd_rpm_get_noresume() and ufshcd_rpm_put() 
next version.

Thanks.
Peter



More information about the Linux-mediatek mailing list