Skip to content
/ linux Public

Commit aa8d68d

Browse files
Thomas YenSasha Levin
authored andcommitted
scsi: ufs: core: Flush exception handling work when RPM level is zero
[ Upstream commit f8ef441 ] 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: 57d104c ("ufs: add UFS power management support") Signed-off-by: Thomas Yen <thomasyen@google.com> Cc: Stable Tree <stable@vger.kernel.org> Reviewed-by: Peter Wang <peter.wang@mediatek.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20260129165156.956601-1-thomasyen@google.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d3e837e commit aa8d68d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9836,6 +9836,8 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
98369836

98379837
if (req_dev_pwr_mode == UFS_ACTIVE_PWR_MODE &&
98389838
req_link_state == UIC_LINK_ACTIVE_STATE) {
9839+
ufshcd_disable_auto_bkops(hba);
9840+
flush_work(&hba->eeh_work);
98399841
goto vops_suspend;
98409842
}
98419843

0 commit comments

Comments
 (0)