Re: [PATCH v2 1/2] scsi: ufs: core: Recover link in ufshcd_set_dev_pwr_mode() on timeout
From: Peter Wang
Date: Mon Nov 16 2026 - 07:46:05 EST
On Fri, 2026-11-13 at 19:12 +0800, Stanley Jhu wrote:
> ufshcd_eh_timed_out() calls ufshcd_link_recovery() when a command
> times out during a power management operation. Link recovery sends a
> NOP OUT, which needs hba->dev_cmd.lock and the only reserved tag.
>
> 1. Runtime resume sends a query with the reserved tag while it holds
> hba->dev_cmd.lock.
> 2. The device does not answer and the query times out.
> 3. ufshcd_eh_timed_out() calls ufshcd_link_recovery().
> 4. In MCQ mode ufshcd_verify_dev_init() waits for hba->dev_cmd.lock
> while __ufshcd_wl_resume() waits for the query. Resume hangs.
> 5. In legacy mode the query completes but the timeout handler still
> holds the reserved tag. The NOP OUT fails with -ENOMEM and the
> host enters UFSHCD_STATE_ERROR.
>
Hi Stanley,
I have a question about the failure flow.
The WL resume flow should be:
Exit hibern8 -> send SSU CMD (Active) -> send DEV (query) CMD.
So it looks like the first two steps succeeded and then the
device command timed out?
Was it accompanied by a UIC error? If yes, at what point did
the UIC error occur?
Thanks
Peter