mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/9] scsi: ufs: core: Fix device management and PM recovery
@ 2026-11-12  5:15 Stanley Jhu
  2026-11-12  5:15 ` [PATCH 1/9] scsi: ufs: core: Do not poll unconfigured MCQ queues in the error handler Stanley Jhu
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Stanley Jhu @ 2026-11-12  5:15 UTC (permalink / raw)
  To: linux-scsi, Martin K. Petersen
  Cc: James E.J. Bottomley, Bart Van Assche, Alim Akhtar, Avri Altman,
	Bean Huo, Peter Wang, Stanley Chu, Can Guo, Bao D. Nguyen,
	Asutosh Das, Hongjie Fang, Praveen Talari, HOYOUNG SEO,
	Brian Kao, Jens Axboe, Rafael J. Wysocki, linux-block,
	linux-kernel

A UFS PM callback holds hba->dev_cmd.lock and the only reserved tag
while it sends device management and START STOP UNIT commands. When
one of these commands times out, ufshcd_eh_timed_out() resets the host
inline, but the reset path needs the same lock and tag, so it
deadlocks or fails. The error handler can also reset the host while
the PM callback is still using it.

This series:
- skips the MCQ completion queue poll when error handling preparation
  left the queues unconfigured (patch 1/9).
- hands PM command timeouts to ufshcd_err_handler() instead of
  resetting the host inline, and fails later PM commands fast
  (patches 2/9 to 4/9).
- disables W-LUN runtime PM during error handling instead of calling
  ufshcd_rpm_get_sync(), so the error handler powers up the host
  itself (patches 5/9 and 6/9).
- keeps the host variant power state balanced across error handling,
  resumes the UFS device W-LUN and wakes suspended logical units after
  a successful reset, and makes the error handler wait for a running
  PM callback (patches 7/9 to 9/9).

Based on mkp/scsi 7.4/scsi-fixes (e550f2b2b4aa) plus Hoyoung Seo's v10
series [1]. On this base, its patch 4/4 needs a context fixup in
__ufshcd_wl_resume() because of commit 6da1bc55c060 ("scsi: ufs: core:
Keep clock-gating hold on failed W-LUN runtime resume").

This series folds in [2] and supersedes [3].

[1] https://lore.kernel.org/r/2052256418.81794387787276.JavaMail.epsvc@epcpadp2new
[2] https://lore.kernel.org/r/20261104112744.1630864-1-stanleyjhu@google.com
[3] https://lore.kernel.org/r/20261105071518.1458428-1-stanleyjhu@google.com

Brian Kao (1):
  scsi: ufs: core: Do not recover the link concurrently with a PM
    callback

Stanley Jhu (8):
  scsi: ufs: core: Do not poll unconfigured MCQ queues in the error
    handler
  scsi: ufs: core: Defer link recovery on reserved PM command timeout
  scsi: ufs: core: Wait for the reserved tag in
    ufshcd_get_dev_mgmt_cmd()
  scsi: ufs: core: Fail PM commands fast when fatal recovery is
    scheduled
  scsi: ufs: core: Disable W-LUN runtime PM in
    ufshcd_err_handling_prepare()
  block: Keep RPM_ACTIVE in blk_pre_runtime_resume() when already active
  scsi: ufs: core: Unwind variant resume in EH when reset fails
  scsi: ufs: core: Wake suspended consumer queues after host reset

 block/blk-pm.c                 |  13 +-
 drivers/ufs/core/ufshcd-priv.h |  19 ++-
 drivers/ufs/core/ufshcd.c      | 244 ++++++++++++++++++++++-----------
 include/ufs/ufshcd.h           |   3 +
 4 files changed, 189 insertions(+), 90 deletions(-)


base-commit: e550f2b2b4aab4c5f12db89d04d8978ce4ed7b4e
prerequisite-patch-id: 0c2cfc48bd97246e47ce689a3a8a364c18a56621
prerequisite-patch-id: 9a413c053d618cedfc6a1a439469bc49a51e060a
prerequisite-patch-id: 961b8b65ac8c9fd1b95d0901347cf504632531e4
prerequisite-patch-id: 9f5c103bac288c258b541cff3742a69fd07892f1
-- 
2.56.0.506.g506a7eabc5-goog


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-11-12  5:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12  5:15 [PATCH 0/9] scsi: ufs: core: Fix device management and PM recovery Stanley Jhu
2026-11-12  5:15 ` [PATCH 1/9] scsi: ufs: core: Do not poll unconfigured MCQ queues in the error handler Stanley Jhu
2026-11-12  5:15 ` [PATCH 2/9] scsi: ufs: core: Defer link recovery on reserved PM command timeout Stanley Jhu
2026-11-12  5:15 ` [PATCH 3/9] scsi: ufs: core: Wait for the reserved tag in ufshcd_get_dev_mgmt_cmd() Stanley Jhu
2026-11-12  5:15 ` [PATCH 4/9] scsi: ufs: core: Fail PM commands fast when fatal recovery is scheduled Stanley Jhu
2026-11-12  5:15 ` [PATCH 5/9] scsi: ufs: core: Disable W-LUN runtime PM in ufshcd_err_handling_prepare() Stanley Jhu
2026-11-12  5:15 ` [PATCH 6/9] block: Keep RPM_ACTIVE in blk_pre_runtime_resume() when already active Stanley Jhu
2026-11-12  5:15 ` [PATCH 7/9] scsi: ufs: core: Unwind variant resume in EH when reset fails Stanley Jhu
2026-11-12  5:15 ` [PATCH 8/9] scsi: ufs: core: Wake suspended consumer queues after host reset Stanley Jhu
2026-11-12  5:15 ` [PATCH 9/9] scsi: ufs: core: Do not recover the link concurrently with a PM callback Stanley Jhu

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®