mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stanley Jhu <stanleyjhu@google.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: "Martin K . Petersen" <mkp@kernel.org>,
	 "James E . J . Bottomley"
	<James.Bottomley@HansenPartnership.com>,
	 Alim Akhtar <alim.akhtar@samsung.com>,
	Bean Huo <beanhuo@micron.com>,
	 Can Guo <can.guo@oss.qualcomm.com>,
	Peter Wang <peter.wang@mediatek.com>,
	 linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/5] scsi: ufs: Fix device management timeouts and runtime PM errors
Date: Tue, 27 Oct 2026 14:22:27 +0800	[thread overview]
Message-ID: <20261027062227.1955867-1-stanleyjhu@google.com> (raw)
In-Reply-To: <5adbbab4-11f2-48be-9924-9d14a06d0ed7@acm.org>

On 10/26/26 4:26 PM, Bart Van Assche wrote:
> Patches 3/5 - 5/5 introduce a behavior change: a failed runtime suspend
> sets power.runtime_error but leaves the W-LUN in the RPM_ACTIVE state.
> Today, sysfs, BSG and hwmon accesses still work in that state. With this
> series they all fail with -EINVAL until the error handler's
> ufshcd_recover_pm_error() clears the flag. Is this behavior change
> intentional?

Thanks for catching this. The v1 cover letter and commit messages were
wrong to claim that a failed W-LUN runtime suspend latches
power.runtime_error.

In __ufshcd_wl_suspend(), every runtime suspend failure path
(ufshcd_bkops_ctrl(), ufshcd_set_dev_pwr_mode() and
ufshcd_link_state_transition()) schedules error recovery and sets
ret = -EBUSY. The vendor vops->suspend callbacks return 0, -EBUSY or
-EAGAIN. rpm_suspend() only sets dev->power.runtime_error when retval is
neither -EBUSY nor -EAGAIN, so a failed W-LUN runtime suspend leaves
power.runtime_error at 0 and runtime_status at RPM_ACTIVE. In that state
pm_runtime_resume_and_get() returns 0 and sysfs, BSG and hwmon accesses
keep working as before.

I checked this on QEMU, with and without this series, in SDB and MCQ
modes, by failing ufshcd_set_dev_pwr_mode() during W-LUN runtime
suspend. rpm_suspend() returned -EBUSY, runtime_error stayed 0, and
sysfs, BSG and debugfs accesses all succeeded.

pm_runtime_resume_and_get() only returns an error when the W-LUN is not
RPM_ACTIVE and runtime resume fails, or when runtime PM is disabled
while the W-LUN is suspended. I will send a v2 that drops the incorrect
runtime_error claim from the cover letter and commit messages.

      reply	other threads:[~2026-10-27  6:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25  1:34 Stanley Jhu
2026-10-25  1:34 ` [PATCH 1/5] scsi: ufs: core: Restore jiffies conversion of device management timeouts Stanley Jhu
2026-10-25  1:34 ` [PATCH 2/5] scsi: ufs: core: Introduce ufshcd_rpm_resume_and_get() helper Stanley Jhu
2026-10-25  1:34 ` [PATCH 3/5] scsi: ufs: sysfs: Propagate runtime PM resume errors Stanley Jhu
2026-10-25  1:34 ` [PATCH 4/5] scsi: ufs: bsg: Abort ufs_bsg_request() when runtime resume fails Stanley Jhu
2026-10-25  1:34 ` [PATCH 5/5] scsi: ufs: hwmon, debugfs: Propagate runtime PM resume errors Stanley Jhu
2026-10-26 23:26 ` [PATCH 0/5] scsi: ufs: Fix device management timeouts and runtime PM errors Bart Van Assche
2026-10-27  6:22   ` Stanley Jhu [this message]

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=20261027062227.1955867-1-stanleyjhu@google.com \
    --to=stanleyjhu@google.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=can.guo@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mkp@kernel.org \
    --cc=peter.wang@mediatek.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®