Re: [PATCH v10 0/4] scsi: ufs: core: Avoid redundant link recovery from the error handler during PM
From: Martin K. Petersen
Date: Tue Nov 17 2026 - 22:44:17 EST
Hoyoung,
> If a LINERESET is reported and the hibern8 exit fails during system
> resume, both ufshcd_err_handler() and __ufshcd_wl_resume() call
> ufshcd_link_recovery(), and the two recoveries are not serialized.
>
> Patch 1 makes ufshcd_link_recovery() clear the saved errors like
> ufshcd_reset_and_restore() does, so the error handler does not act on
> errors that have already been recovered.
>
> Patches 2 and 3 make ufshcd_wl_poweroff() behave like
> ufshcd_wl_suspend() by sharing its implementation. In particular it now
> holds host_sem, so that the error handler waits for it, and the release
> of host_sem is balanced if hibernation is aborted.
>
> Patch 4 restricts the early link recovery in ufshcd_err_handler(), which
> does not hold host_sem, to runtime PM. For system PM and poweroff the
> error handler now waits for host_sem, and for shutdown it stops.
Applied to 7.5/scsi-staging, thanks!
--
Martin K. Petersen