Re: [PATCH] scsi: ufs: core: Keep clock-gating hold on failed W-LUN runtime resume

From: Martin K. Petersen

Date: Tue Nov 03 2026 - 23:02:04 EST



Stanley,

> 1. __ufshcd_wl_suspend() takes one ufshcd_hold() reference and sets
> hba->clk_gating.is_suspended while the UFS device W-LUN enters
> RPM_SUSPENDED.
> 2. Since commit eef1d74bf88f ("PM: runtime: Only set runtime_error on
> suspend callback failures"), a failed runtime resume (for example
> START STOP UNIT completing with an error) leaves the W-LUN in
> RPM_SUSPENDED with power.runtime_error == 0, while
> __ufshcd_wl_resume() already clears hba->clk_gating.is_suspended and
> calls ufshcd_release().
> 3. The next W-LUN runtime resume runs __ufshcd_wl_resume() again without
> an intervening suspend and calls ufshcd_release() a second time,
> dropping a reference it does not own and underflowing
> hba->clk_gating.active_reqs on UFSHCD_CAP_CLK_GATING hosts.

Applied to 7.4/scsi-fixes, thanks!

--
Martin K. Petersen