Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Guangshuo Li" <lgs201920130244@gmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2] scsi: ufs: core: cancel RTC work in active-active suspend
Date: Tue, 14 Jul 2026 17:44:05 +0000	[thread overview]
Message-ID: <20260714174406.6FD471F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260714172726.1736967-1-lgs201920130244@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `ufs_rtc_update_work` is permanently lost if `__ufshcd_wl_suspend()` fails after cancelling it in the active-active suspend path, stopping periodic UFS RTC updates until the next successful suspend/resume cycle.
--

--- Patch [1]: [PATCH v2] scsi: ufs: core: cancel RTC work in active-active suspend ---
commit 9a4850975ce80edc6032f13153aa50eb19b4cc19
Author: Guangshuo Li <lgs201920130244@gmail.com>

scsi: ufs: core: cancel RTC work in active-active suspend
    
This commit cancels the UFS RTC update work in the active-active suspend
path before calling the vendor suspend callback to prevent an SError.

> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index d3044a3089b53..c3b105b2678e4 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -10269,6 +10269,7 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
>  			req_link_state == UIC_LINK_ACTIVE_STATE) {
>  		ufshcd_disable_auto_bkops(hba);
>  		flush_work(&hba->eeh_work);
> +		cancel_delayed_work_sync(&hba->ufs_rtc_update_work);

[Severity: Medium]
If the active-active suspend path fails after this point, is the
ufs_rtc_update_work permanently lost?

When this jumps to the vops_suspend label, if ufshcd_vops_suspend() returns
an error, the function branches to the error handling path:

__ufshcd_wl_suspend() {
    ...
vops_suspend:
	ret = ufshcd_vops_suspend(hba, pm_op, POST_CHANGE);
	if (ret)
		goto set_link_active;
    ...
out:
	...
	if (ret) {
		ufshcd_update_evt_hist(hba, UFS_EVT_WL_SUSP_ERR, (u32)ret);
		hba->clk_gating.is_suspended = false;
		ufshcd_release(hba);
	}
	hba->pm_op_in_progress = false;
	return ret;
}

The error path doesn't appear to re-arm the canceled RTC update work before
returning the error code. Does this mean periodic UFS RTC updates will stay
stopped until the next successful suspend and resume cycle?

>  		goto vops_suspend;
>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260714172726.1736967-1-lgs201920130244@gmail.com?part=1

      reply	other threads:[~2026-07-14 17:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 17:27 [PATCH v2] scsi: ufs: core: cancel RTC work in active-active suspend Guangshuo Li
2026-07-14 17:44 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260714174406.6FD471F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=lgs201920130244@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox