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

From: Martin K. Petersen (Oracle)

Date: Sun Nov 08 2026 - 22:58:38 EST


On Thu, 29 Oct 2026 15:08:30 +0800, Stanley Jhu wrote:

> 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!

[1/1] scsi: ufs: core: Keep clock-gating hold on failed W-LUN runtime resume
https://git.kernel.org/mkp/scsi/c/6da1bc55c060

--
Martin K. Petersen