mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Wang <peter.wang@mediatek.com>
To: Stanley Jhu <stanleyjhu@google.com>, <linux-scsi@vger.kernel.org>,
	"Martin K. Petersen" <mkp@kernel.org>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Bart Van Assche" <bvanassche@acm.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	"Bean Huo" <beanhuo@micron.com>, Brian Kao <powenkao@google.com>,
	Can Guo <can.guo@oss.qualcomm.com>,
	"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
	Hongjie Fang <hongjiefang@asrmicro.com>,
	Praveen Talari <praveen.talari@oss.qualcomm.com>,
	Hoyoung Seo <hy50.seo@samsung.com>,
	"John Garry" <john.garry@linux.dev>,
	Hyeoncheol Jeong <hyenc.jeong@samsung.com>,
	Jens Axboe <axboe@kernel.dk>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	<linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] scsi: ufs: core: Recover link in ufshcd_set_dev_pwr_mode() on timeout
Date: Mon, 16 Nov 2026 20:45:50 +0800	[thread overview]
Message-ID: <799eefce7dabf96c7377832cd5ae5196b0b5d174.camel@mediatek.com> (raw)
In-Reply-To: <20261113111202.3551341-2-stanleyjhu@google.com>

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

  parent reply	other threads:[~2026-11-16 12:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 11:12 [PATCH v2 0/2] scsi: ufs: core: Fix device management and PM recovery Stanley Jhu
2026-11-13 11:12 ` [PATCH v2 1/2] scsi: ufs: core: Recover link in ufshcd_set_dev_pwr_mode() on timeout Stanley Jhu
2026-11-13 20:37   ` Bart Van Assche
2026-11-15  8:20     ` Stanley Jhu
2026-11-16 12:45   ` Peter Wang [this message]
2026-11-13 11:12 ` [PATCH v2 2/2] scsi: ufs: core: Do not recover the link concurrently with a PM callback Stanley Jhu
2026-11-16 12:53   ` Peter Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=799eefce7dabf96c7377832cd5ae5196b0b5d174.camel@mediatek.com \
    --to=peter.wang@mediatek.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=can.guo@oss.qualcomm.com \
    --cc=hongjiefang@asrmicro.com \
    --cc=hy50.seo@samsung.com \
    --cc=hyenc.jeong@samsung.com \
    --cc=john.garry@linux.dev \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mkp@kernel.org \
    --cc=powenkao@google.com \
    --cc=praveen.talari@oss.qualcomm.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stanleyjhu@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®