From: Thomas Yen <thomasyen@google.com>
Cc: Thomas Yen <thomasyen@google.com>,
Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
Bart Van Assche <bvanassche@acm.org>,
"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>,
Adrian Hunter <adrian.hunter@intel.com>,
"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
"open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER"
<linux-scsi@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/1] scsi: ufs: core: Flush exception handling work when RPM level is zero
Date: Mon, 26 Jan 2026 11:19:15 +0800 [thread overview]
Message-ID: <20260126031921.2511736-1-thomasyen@google.com> (raw)
Ensure that the exception event handling work (&hba->eeh_work) is
explicitly flushed during suspend when the runtime power management
level (rpm_lvl) is set to UFS_PM_LVL_0.
When the RPM level is zero, the device power mode remains active and the
link remains in an active state. In this specific configuration, the UFS
core driver previously bypassed the flushing of exception event
handling jobs. This created a race condition where the driver could
attempt to access the host controller to handle an exception after the
system had already entered a deep power-down state, leading to a system
crash.
By explicitly flushing this work before the suspend callback proceeds,
pending exception handling tasks are guaranteed to complete, preventing
illegal hardware access during the power-down sequence.
Signed-off-by: Thomas Yen <thomasyen@google.com>
---
drivers/ufs/core/ufshcd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 0369043ca010..3a0e6c9ba86a 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -9997,6 +9997,7 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
if (req_dev_pwr_mode == UFS_ACTIVE_PWR_MODE &&
req_link_state == UIC_LINK_ACTIVE_STATE) {
+ flush_work(&hba->eeh_work);
goto vops_suspend;
}
base-commit: a48ca06cf343423faa01c573aeafba9fa5f92577
--
2.52.0.457.g6b5491de43-goog
next reply other threads:[~2026-01-26 3:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 3:19 Thomas Yen [this message]
2026-01-26 18:12 ` [PATCH 1/1] scsi: ufs: core: Flush exception handling work when RPM level is zero Bart Van Assche
2026-02-04 3:05 ` 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=20260126031921.2511736-1-thomasyen@google.com \
--to=thomasyen@google.com \
--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=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=peter.wang@mediatek.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