Skip to contentSkip to conversation

ufs: core: Disable timestamp functionality if not supported

PATCH Applied Bart Van Assche 6 participants 8 messages Sep 9, 2025 – Sep 20, 2025

Subsystems (2)
lore
Share & tools
lore

Bart Van Assche

author reviewer
#0 lore raw

PATCH 1/1 ufs: core: Disable timestamp functionality if not supported

Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT for these devices such that no error messages appear in the kernel log about failures to set the qTimestamp attribute.

---
 drivers/ufs/core/ufshcd.c | 6 +++++-
 include/ufs/ufs_quirks.h  | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +5 -1
index ca6a0f8ccbea..5d0793d8b0e9 100644
@@ -316,6 +316,9 @@ static const struct ufs_dev_quirk ufs_fixups[] = {
 	{ .wmanufacturerid = UFS_VENDOR_TOSHIBA,
 	  .model = "THGLF2G9D8KBADG",
 	  .quirk = UFS_DEVICE_QUIRK_PA_TACTIVATE },
+	{ .wmanufacturerid = UFS_VENDOR_TOSHIBA,
+	  .model = "THGJFJT1E45BATP",
+	  .quirk = UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT },
 	{}
 };
 
@@ -8777,7 +8780,8 @@ static void ufshcd_set_timestamp_attr(struct ufs_hba *hba)
 	struct ufs_dev_info *dev_info = &hba->dev_info;
 	struct utp_upiu_query_v4_0 *upiu_data;
 
-	if (dev_info->wspecversion < 0x400)
+	if (dev_info->wspecversion < 0x400 ||
+	    hba->dev_quirks & UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT)
 		return;
 
 	ufshcd_dev_man_lock(hba);
include/ufs/ufs_quirks.h +3 -0
index f52de5ed1b3b..83563247c36c 100644
@@ -113,4 +113,7 @@ struct ufs_dev_quirk {
  */
 #define UFS_DEVICE_QUIRK_PA_HIBER8TIME          (1 << 12)
 
+/* Some UFS 4 devices do not support the qTimestamp attribute */
+#define UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT	(1 << 13)
+
 #endif /* UFS_QUIRKS_H_ */
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines

Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT for these devices such
that no error messages appear in the kernel log about failures to set the qTimestamp attribute.

Meanwhile maybe you can use rtc instead.

Quoted 2 lines
author reviewer
#2 lore raw
Quoted 7 lines · Avri Altman
Quoted 5 lines

Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT for these devices such
that no error messages appear in the kernel log about failures to set the qTimestamp attribute.

Meanwhile maybe you can use rtc instead.

How about leaving it to the device manufacturer (Kioxia in this case) to improve support for UFS devices that are not fully compliant with the UFS 4.0 specification? Anyway, thanks for the review.

Bart.

Tested-by Reviewed-by on v1 1/1
#3 lore raw
In reply to Bart Van Assche
Quoted 41 lines · Bart Van Assche

Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT for these devices such that no error messages appear in the kernel log about failures to set the qTimestamp attribute.

---
  drivers/ufs/core/ufshcd.c | 6 +++++-
  include/ufs/ufs_quirks.h  | 3 +++
  2 files changed, 8 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +5 -1
index ca6a0f8ccbea..5d0793d8b0e9 100644
@@ -316,6 +316,9 @@ static const struct ufs_dev_quirk ufs_fixups[] = {
  	{ .wmanufacturerid = UFS_VENDOR_TOSHIBA,
  	  .model = "THGLF2G9D8KBADG",
  	  .quirk = UFS_DEVICE_QUIRK_PA_TACTIVATE },
+	{ .wmanufacturerid = UFS_VENDOR_TOSHIBA,
+	  .model = "THGJFJT1E45BATP",
+	  .quirk = UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT },
  	{}
  };
 
@@ -8777,7 +8780,8 @@ static void ufshcd_set_timestamp_attr(struct ufs_hba *hba)
  	struct ufs_dev_info *dev_info = &hba->dev_info;
  	struct utp_upiu_query_v4_0 *upiu_data;
 
-	if (dev_info->wspecversion < 0x400)
+	if (dev_info->wspecversion < 0x400 ||
+	    hba->dev_quirks & UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT)
  		return;
 
  	ufshcd_dev_man_lock(hba);
include/ufs/ufs_quirks.h +0 -0
index f52de5ed1b3b..83563247c36c 100644

include/ufs/ufs_quirks.h struct ufs_dev_quirk { · line 119

Quoted 7 lines
include/ufs/ufs_quirks.h +3 -0
@@ -113,4 +113,7 @@ struct ufs_dev_quirk {
   */
  #define UFS_DEVICE_QUIRK_PA_HIBER8TIME          (1 << 12)
 
+/* Some UFS 4 devices do not support the qTimestamp attribute */
+#define UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT	(1 << 13)
+
  #endif /* UFS_QUIRKS_H_ */
Reviewed-by on v1 1/1
#5 lore raw
In reply to Bart Van Assche
Quoted 6 lines · Bart Van Assche

Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT for these devices such that no error messages appear in the kernel log about failures to set the qTimestamp attribute.

One comment below.

Quoted 10 lines
---
 drivers/ufs/core/ufshcd.c | 6 +++++-
 include/ufs/ufs_quirks.h  | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +0 -0
index ca6a0f8ccbea..5d0793d8b0e9 100644

drivers/ufs/core/ufshcd.c static const struct ufs_dev_quirk ufs_fixups[] = { · line 319

Quoted 4 lines
drivers/ufs/core/ufshcd.c +1 -0
@@ -316,6 +316,9 @@ static const struct ufs_dev_quirk ufs_fixups[] = {
 	{ .wmanufacturerid = UFS_VENDOR_TOSHIBA,
 	  .model = "THGLF2G9D8KBADG",
 	  .quirk = UFS_DEVICE_QUIRK_PA_TACTIVATE },
+	{ .wmanufacturerid = UFS_VENDOR_TOSHIBA,

Should we UFS_VENDOR_KIOXIA since the product itself is marketed as a KIOXIA UFS device?

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்
#6 lore raw
In reply to Bart Van Assche

Bart,

Quoted 4 lines

Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT for these devices such that no error messages appear in the kernel log about failures to set the qTimestamp attribute.

Applied to 6.18/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen
#7 lore raw
In reply to Bart Van Assche
Quoted 6 lines · Bart Van Assche

Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORT for these devices such that no error messages appear in the kernel log about failures to set the qTimestamp attribute.

Applied to 6.18/scsi-queue, thanks!

[1/1] ufs: core: Disable timestamp functionality if not supported

      https://git.kernel.org/mkp/scsi/c/fb1f45683461
Signature · 1 line
Martin K. Petersen