Re: [PATCH v2] scsi: ufs: core: cancel RTC work in active-active suspend
From: Peter Wang (王信友)
Date: Wed Jul 15 2026 - 01:35:28 EST
On Wed, 2026-07-15 at 01:27 +0800, Guangshuo Li wrote:
> UFS RTC support schedules ufs_rtc_update_work to periodically update
> the
> device RTC. The work can issue query commands and access the UFS host
> controller.
>
> A previous change moved the RTC work cancellation before the
> PRE_CHANGE
> vendor suspend callback to close a race in the common suspend path.
> However, the active-active path jumps directly to vops_suspend after
> flushing exception handling work and therefore bypasses the
> cancellation.
>
> If the RTC work runs while the vendor suspend callback is gating or
> otherwise changing hardware state, it can access the controller
> during
> suspend and trigger an SError.
>
> Cancel the RTC work before entering the vendor suspend callback in
> the
> active-active path. Since this path now cancels the work, move the
> RTC
> work scheduling outside the device and link state restoration block
> in
> the resume path. This restarts RTC updates after an active-active
> suspend and resume cycle.
>
> Fixes: b0bd84c39289 ("scsi: ufs: core: Fix SError in
> ufshcd_rtc_work() during UFS suspend")
> Signed-off-by: Guangshuo Li <lgs201920130244@xxxxxxxxx>
> ---
Reviewed-by: Peter Wang <peter.wang@xxxxxxxxxxxx>