From: sashiko-bot@kernel.org
To: "Enric Balletbo i Serra" <eballetb@redhat.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi: ufs: core: Use ufshcd_query_attr_retry() for RTC update
Date: Mon, 16 Nov 2026 13:51:09 +0000 [thread overview]
Message-ID: <sashiko-outbox-217115@kernel.org> (raw)
In-Reply-To: <20261116-ufs-rtc-query-retry-v1-1-4de69b175e8d@redhat.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] scsi: ufs: core: ufshcd_query_attr_retry() still logs dev_err on
transient error
--
commit 9b18c975bcb0273e30706599adab61914367c5c2
Author: Enric Balletbo i Serra <eballetb@redhat.com>
scsi: ufs: core: Use ufshcd_query_attr_retry() for RTC update
This commit switches ufshcd_update_rtc() from ufshcd_query_attr() to
ufshcd_query_attr_retry() when writing QUERY_ATTR_IDN_SECONDS_PASSED.
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 3c28bc67c65f1..1cd32b7cc9674 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -8821,8 +8821,8 @@ static void ufshcd_update_rtc(struct ufs_hba *hba)
> if (ufshcd_rpm_get_if_active(hba) <= 0)
> return;
>
> - err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR, QUERY_ATTR_IDN_SECONDS_PASSED,
> - 0, 0, &val);
> + err = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
> + QUERY_ATTR_IDN_SECONDS_PASSED, 0, 0, &val);
[Severity: Low]
Does ufshcd_query_attr_retry() avoid escalating to dev_err() on transient
failures as described in the commit message?
ufshcd_query_attr_retry() calls ufshcd_query_attr() on every attempt, and
ufshcd_query_attr() logs dev_err() unconditionally on any error other than
-EOPNOTSUPP:
drivers/ufs/core/ufshcd.c:ufshcd_query_attr() {
...
err = ufshcd_exec_dev_cmd(hba, DEV_CMD_TYPE_QUERY, dev_cmd_timeout);
if (err == -EOPNOTSUPP)
goto out_unlock;
if (err) {
dev_err(hba->dev, "%s: opcode 0x%.2x for idn %d failed, index %d, err = %d\n",
__func__, opcode, idn, index, err);
goto out_unlock;
}
...
}
Retrying allows a transient OCS_INVALID_COMMAND_STATUS failure to recover
and avoids the "ufshcd_update_rtc: Failed to update rtc 15" message, but
"ufshcd_query_attr: opcode 0x04 for idn 15 failed, index 0, err = 15" is
still logged at dev_err level on the initial failed attempt.
Also, callers in ufs-hwmon.c, ufs-sysfs.c, and ufs-txeq.c call
ufshcd_query_attr() directly, so ufshcd_update_rtc() is not the only direct
caller in drivers/ufs/core/.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-ufs-rtc-query-retry-v1-1-4de69b175e8d@redhat.com?part=1
prev parent reply other threads:[~2026-11-16 13:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 13:39 [PATCH] scsi: ufs: core: Use ufshcd_query_attr_retry() for RTC update Enric Balletbo i Serra
2026-11-16 13:51 ` 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=sashiko-outbox-217115@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=eballetb@redhat.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