[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <29008631-7994-4afc-9f4a-43d6b98862b9@acm.org>
Date: Mon, 26 Jan 2026 10:12:13 -0800
From: Bart Van Assche <bvanassche@....org>
To: Thomas Yen <thomasyen@...gle.com>
Cc: Alim Akhtar <alim.akhtar@...sung.com>, Avri Altman <avri.altman@....com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Peter Wang <peter.wang@...iatek.com>, Bean Huo <beanhuo@...ron.com>,
Adrian Hunter <adrian.hunter@...el.com>,
"Bao D. Nguyen" <quic_nguyenb@...cinc.com>,
"open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER"
<linux-scsi@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] scsi: ufs: core: Flush exception handling work when
RPM level is zero
On 1/25/26 7:19 PM, Thomas Yen wrote:
> 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@...gle.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;
> }
A "Cc: stable" tag is missing. Since otherwise this patch looks good to
me:
Reviewed-by: Bart Van Assche <bvanassche@....org>
Powered by blists - more mailing lists