[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260129165156.956601-1-thomasyen@google.com>
Date: Fri, 30 Jan 2026 00:51:51 +0800
From: Thomas Yen <thomasyen@...gle.com>
To: martin.petersen@...cle.com, James.Bottomley@...senPartnership.com
Cc: Thomas Yen <thomasyen@...gle.com>, Stable Tree <stable@...r.kernel.org>,
Alim Akhtar <alim.akhtar@...sung.com>, Avri Altman <avri.altman@....com>,
Bart Van Assche <bvanassche@....org>, Peter Wang <peter.wang@...iatek.com>,
Bean Huo <beanhuo@...ron.com>, Adrian Hunter <adrian.hunter@...el.com>,
"Bao D. Nguyen" <quic_nguyenb@...cinc.com>, Subhash Jadavani <subhashj@...eaurora.org>,
Dolev Raviv <draviv@...eaurora.org>, Sujit Reddy Thumma <sthumma@...eaurora.org>,
"open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER" <linux-scsi@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>
Subject: [PATCH v4 1/1] scsi: ufs: core: Flush exception handling work when
RPM level is zero
Ensure that the exception event handling work is explicitly flushed
during suspend when the runtime power management level is set to
UFS_PM_LVL_0.
When the RPM level is zero, the device power mode and link state both
remain active. Previously, the UFS core driver bypassed flushing
exception event handling jobs in this configuration. 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, resulting in a system crash.
Explicitly flush this work and disable auto BKOPs before the suspend
callback proceeds. This guarantees that pending exception tasks complete
and prevents illegal hardware access during the power-down sequence.
Fixes: 57d104c153d3 ("scsi: ufs: ufshcd: Fix link state during system suspend")
Signed-off-by: Thomas Yen <thomasyen@...gle.com>
Cc: Stable Tree <stable@...r.kernel.org>
---
v4:
- Add Fixes tag.
v3:
- Add logic to disable BKOPs.
v2:
- Add Cc: stable tag.
- Reformat commit message text for better line wrapping.
drivers/ufs/core/ufshcd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 0369043ca010..8c88dd5c2cca 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -9997,6 +9997,8 @@ 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) {
+ ufshcd_disable_auto_bkops(hba);
+ flush_work(&hba->eeh_work);
goto vops_suspend;
}
base-commit: a48ca06cf343423faa01c573aeafba9fa5f92577
--
2.53.0.rc1.225.gd81095ad13-goog
Powered by blists - more mailing lists