ufs: core: Disable timestamp functionality if not supported
Subsystems (2)
Bart Van Assche
reviewerPATCH 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
@@ -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
@@ -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_ */
Quoted 5 lines
Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the
UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORTfor 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
Signed-off-by Bart Van Assche <[email protected]>
Bart Van Assche
reviewerQuoted 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_SUPPORTfor 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.
Quoted 41 lines · Bart Van Assche
Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the
UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORTfor these devices such that no error messages appear in the kernel log about failures to set the qTimestamp attribute.Signed-off-by Bart Van Assche <[email protected]>--- 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@@ -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
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_ */
Quoted 6 lines · Bart Van Assche
Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the
UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORTfor these devices such that no error messages appear in the kernel log about failures to set the qTimestamp attribute.Signed-off-by Bart Van Assche <[email protected]>
Quoted 6 lines · Bart Van Assche
Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the
UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORTfor these devices such that no error messages appear in the kernel log about failures to set the qTimestamp attribute.Signed-off-by Bart Van Assche <[email protected]>
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
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
மணிவண்ணன் சதாசிவம்
Martin K. Petersen
AppliedBart,
Quoted 4 lines
Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the
UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORTfor 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
Martin K. Petersen
AppliedQuoted 6 lines · Bart Van Assche
Some Kioxia UFS 4 devices do not support the qTimestamp attribute. Set the
UFS_DEVICE_QUIRK_NO_TIMESTAMP_SUPPORTfor 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