[PATCH 0/2] scsi: ufs: core: Handle devices declining optional Query IDNs

Stanley Jhu posted 2 patches 2 weeks ago
drivers/ufs/core/ufshcd.c | 39 ++++++++++++++++++++++++++++++---------
include/ufs/ufs.h         |  1 +
2 files changed, 31 insertions(+), 9 deletions(-)
[PATCH 0/2] scsi: ufs: core: Handle devices declining optional Query IDNs
Posted by Stanley Jhu 2 weeks ago
JEDEC JESD220F specifies that a device which does not support an
optional Query IDN returns QUERY_RESULT_INVALID_IDN (0xFD) in the
Query Response UPIU.

The driver maps every non-zero Query response to -EINVAL and logs
dev_err(). A device declining an optional IDN is spec-compliant, so
this reports a failure that did not happen and keeps the retry loops
resending a request the device will never accept. On UFS 4.0 parts
that omit the Timestamp attribute it repeats on every boot and every
resume.

A third model was recently proposed for
UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT; recognising the rejection at
runtime avoids growing that table further.

Patch 1 decodes 0xFD as -EOPNOTSUPP across the query layer. Patch 2
uses that to stop reissuing the Timestamp write on devices that
reject it.

Compile tested on arm64 (defconfig + SCSI_UFSHCD).

Stanley Jhu (2):
  scsi: ufs: core: Fast-abort unsupported Query IDNs
  scsi: ufs: core: Dynamically disable timestamp on unsupported devices

 drivers/ufs/core/ufshcd.c | 39 ++++++++++++++++++++++++++++++---------
 include/ufs/ufs.h         |  1 +
 2 files changed, 31 insertions(+), 9 deletions(-)

-- 
2.55.0.1007.g17ff1f9808-goog
Re: [PATCH 0/2] scsi: ufs: core: Handle devices declining optional Query IDNs
Posted by Stanley Jhu 4 days, 21 hours ago
On Fri, 11 Sep 2026 10:18:47 +0800, Stanley Jhu wrote:
> Compile tested on arm64 (defconfig + SCSI_UFSHCD).

Quick update for the thread: Xilin Wu tested this series on hardware
with a Kioxia THGJFJT2T85BAT0A UFS 4.0 part (with the device quirk
dropped) and confirmed in [1] that it resolves the 0xFD Query response
errors on boot and resume.

[1] https://lore.kernel.org/linux-scsi/B6ED6CADE807138B+422dda6a-301a-4bd1-befd-b932ea9f46e0@radxa.com/