]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: ufs: core: Flush exception handling work when RPM level is zero
authorThomas Yen <thomasyen@google.com>
Thu, 29 Jan 2026 16:51:51 +0000 (00:51 +0800)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:21:22 +0000 (07:21 -0500)
commit78d8e2d6352e8317686ee3a44811ac14c415a57d
tree1470803e19b6c17248159650d98363bb09d707c7
parent08c7eadd8a934a1968e1aeeee8b61b853b99fb3a
scsi: ufs: core: Flush exception handling work when RPM level is zero

[ Upstream commit f8ef441811ec413717f188f63d99182f30f0f08e ]

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 ("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>
drivers/ufs/core/ufshcd.c