From: Bart Van Assche <bvanassche@acm.org>
To: Po-Wen Kao <powenkao@google.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Peter Wang <peter.wang@mediatek.com>,
Bean Huo <beanhuo@micron.com>,
Manivannan Sadhasivam <mani@kernel.org>,
"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER"
<linux-scsi@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] scsi: ufs: core: Fix EH failure after wlun resume error
Date: Thu, 20 Nov 2025 08:32:08 -0800 [thread overview]
Message-ID: <8cc2cf81-c1c8-4d00-a0d1-39b047b91280@acm.org> (raw)
In-Reply-To: <20251112063214.1195761-1-powenkao@google.com>
On 11/11/25 10:32 PM, Po-Wen Kao wrote:
> When a W-LUN resume fails, its parent devices in the SCSI hierarchy,
> including the scsi_target, may be runtime suspended. Subsequently, the
> error handler in ufshcd_recover_pm_error() fails to set the W-LUN
> device back to active because the parent target is not active.
> This results in the following errors:
>
> google-ufshcd 3c2d0000.ufs: ufshcd_err_handler started; HBA state eh_fatal; ...
> ufs_device_wlun 0:0:0:49488: START_STOP failed for power mode: 1, result 40000
> ufs_device_wlun 0:0:0:49488: ufshcd_wl_runtime_resume failed: -5
> ...
> ufs_device_wlun 0:0:0:49488: runtime PM trying to activate child device 0:0:0:49488 but parent (target0:0:0) is not active
>
> This patch addresses this by:
>
> 1. Ensuring the W-LUN's parent scsi_target is runtime resumed before
> attempting to set the W-LUN to active within ufshcd_recover_pm_error().
> 2. Explicitly checking for power.runtime_error on the HBA and W-LUN
> devices before calling pm_runtime_set_active() to clear the error state.
> 3. Adding pm_runtime_get_sync(hba->dev) in
> ufshcd_err_handling_prepare() to ensure the HBA itself
> is active during error recovery, even if a child device resume failed.
>
> These changes ensure the device power states are managed correctly
> during error recovery.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
next prev parent reply other threads:[~2025-11-20 16:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 6:32 [PATCH 1/1] scsi: ufs: core: Fix EH failure after wlun resume error Po-Wen Kao
2025-11-12 8:17 ` Peter Wang (王信友)
[not found] ` <CA+=0d2YnrDL41DXtC8kDmtXioy4+hohGsmrOPxJY31jqt22uww@mail.gmail.com>
2025-11-12 9:29 ` Brian Kao
2025-11-13 10:06 ` Peter Wang (王信友)
2025-11-18 7:26 ` Brian Kao
2025-11-19 9:18 ` Peter Wang (王信友)
2025-11-19 23:44 ` Brian Kao
2025-11-20 13:14 ` Peter Wang (王信友)
2025-11-20 16:32 ` Bart Van Assche [this message]
2025-11-29 20:02 ` Martin K. Petersen
2025-12-09 3:21 ` Martin K. Petersen
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=8cc2cf81-c1c8-4d00-a0d1-39b047b91280@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=adrian.hunter@intel.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=peter.wang@mediatek.com \
--cc=powenkao@google.com \
--cc=quic_nguyenb@quicinc.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