Re: [PATCH] scsi: ufs: core: Use ufshcd_query_attr_retry() for RTC update
From: Bean Huo
Date: Mon Nov 16 2026 - 17:28:21 EST
Thanks for the patch. A few comments:
On Mon, 2026-11-16 at 14:39 +0100, 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
this is printed by ufshcd_query_attr() itself at dev_err level, so it will still
show up with this patch. Could you share the log with the patch applied?
and err = 15 is OCS_INVALID_COMMAND_STATUS, the value the driver puts in the
UTRD before sending. So the request was completed but the host controller did
not update OCS. This looks like a host side problem? not a transient device
failure, and a retry here would only hide it. Is this SDB or MCQ? Does it only
happen on the first RTC update after probe?
> 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.
>
ufshcd_update_rtc() is not the only caller without retry. ufs-sysfs.c, ufs-
hwmon.c and ufs-txeq.c also call ufshcd_query_attr() directly, so the commit
message is wrong.
> Fixes: 6bf999e0eb41 ("scsi: ufs: core: Add UFS RTC support")
> Signed-off-by: Enric Balletbo i Serra <eballetb@xxxxxxxxxx>
I would like to understand the root cause first.
Kind regards,
Bean