From: Larisa Ileana Grigore <larisa.grigore@oss.nxp.com>
To: "Enric Balletbo i Serra" <eballetb@redhat.com>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"Bart Van Assche" <bvanassche@acm.org>,
"Bean Huo" <beanhuo@micron.com>,
"Stanley Jhu" <stanleyjhu@google.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <mkp@kernel.org>,
"Mike Bi" <mikebi@micron.com>,
"Avri Altman" <avri.altman@sandisk.com>,
"Thomas Weißschuh" <linux@weissschuh.net>
Cc: Luca Porzio <lporzio@micron.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
NXP S32 Linux Team <s32@nxp.com>,
linux-arm-kernel@lists.infradead.org, Frank Li <Frank.Li@nxp.com>
Subject: Re: [PATCH] scsi: ufs: core: Use ufshcd_query_attr_retry() for RTC update
Date: Mon, 16 Nov 2026 16:38:29 +0200 [thread overview]
Message-ID: <1fb7c21d-6852-4930-828f-c790ee49747c@oss.nxp.com> (raw)
In-Reply-To: <20261116-ufs-rtc-query-retry-v1-1-4de69b175e8d@redhat.com>
On 11/16/2026 3:39 PM, Enric Balletbo i Serra wrote:
> ufshcd_update_rtc() uses ufshcd_query_attr() directly to write the
> bSecondsPassed attribute, making it the only query attribute caller in
> the UFS core that does not use the retry variant. All other callers use
> ufshcd_query_attr_retry(), which retries up to three times on transient
> failures before escalating to dev_err.
>
> This causes spurious error messages during boot on some platforms when
> the write-attribute command hits a transient OCS_INVALID_COMMAND_STATUS
> error:
>
> ufs-s32n7 4ac80000.ufs: ufshcd_query_attr: opcode 0x04 for idn 15 failed, index 0, err = 15
> ufs-s32n7 4ac80000.ufs: ufshcd_update_rtc: Failed to update rtc 15
>
> Switch to ufshcd_query_attr_retry() to handle transient failures
> gracefully, consistent with every other attribute query in the driver.
>
> Fixes: 6bf999e0eb41 ("scsi: ufs: core: Add UFS RTC support")
> Signed-off-by: Enric Balletbo i Serra <eballetb@redhat.com>
> ---
> drivers/ufs/core/ufshcd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 3c28bc67c65f..1cd32b7cc967 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);
> ufshcd_rpm_put(hba);
>
> if (err)
>
> ---
> base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
> change-id: 20261116-ufs-rtc-query-retry-3f27084f878f
>
> Best regards,
Hello Enric,
Regarding the OCS_INVALID_COMMAND_STATUS seen on S32N79RDB, this
behavior is related to known errata that will be documented in the
future. I plan to submit a separate patch series to address these errata.
For this issue, OCS values 0xf and 0x3 are expected.
Best regards,
Larisa
prev parent reply other threads:[~2026-11-16 14:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 13:39 Enric Balletbo i Serra
2026-11-16 14:38 ` Larisa Ileana Grigore [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=1fb7c21d-6852-4930-828f-c790ee49747c@oss.nxp.com \
--to=larisa.grigore@oss.nxp.com \
--cc=Frank.Li@nxp.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@sandisk.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=eballetb@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=lporzio@micron.com \
--cc=mikebi@micron.com \
--cc=mkp@kernel.org \
--cc=s32@nxp.com \
--cc=stanleyjhu@google.com \
/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
all inboxes | Powered by JetHome®