Skip to contentSkip to conversation

ufs: core: support UFS 4.1 CQ entry tag

PATCH Superseded [email protected] 2 participants 4 messages Feb 9 – Feb 10

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ufs: core: support UFS 4.1 CQ entry tag

From: Peter Wang <[email protected]>

The UFS 4.1 specification introduces a new completion queue(CQ) entry format, allowing the tag to be obtained directly.

---
 drivers/ufs/core/ufs-mcq.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/ufs/core/ufs-mcq.c +6 -1
index ad0ada57959a..d8b5cf18a01c 100644
@@ -273,13 +273,18 @@ void ufshcd_mcq_write_cqis(struct ufs_hba *hba, u32 val, int i)
 EXPORT_SYMBOL_GPL(ufshcd_mcq_write_cqis);
 
 /*
- * Current MCQ specification doesn't provide a Task Tag or its equivalent in
+ * UFS 4.0 MCQ specification doesn't provide a Task Tag or its equivalent in
  * the Completion Queue Entry. Find the Task Tag using an indirect method.
+ * UFS 4.1 and above can directly return the Task Tag in the Completion Queue
+ * Entry.
  */
 static int ufshcd_mcq_get_tag(struct ufs_hba *hba, struct cq_entry *cqe)
 {
 	u64 addr;
 
+	if (hba->ufs_version >= ufshci_version(4, 1))
+		return cqe->task_tag;
+
 	/* sizeof(struct utp_transfer_cmd_desc) must be a multiple of 128 */
 	BUILD_BUG_ON(sizeof(struct utp_transfer_cmd_desc) & GENMASK(6, 0));
 
Signature · 1 line
2.45.2
#1 lore raw
Quoted 2 lines · On 2/9/26 4:20 AM, [email protected] wrote:

The UFS 4.1 specification introduces a new completion queue(CQ) entry format, allowing the tag to be obtained directly.

UFS -> UFSHCI

Quoted 5 lines
drivers/ufs/core/ufs-mcq.c +0 -0
index ad0ada57959a..d8b5cf18a01c 100644

drivers/ufs/core/ufs-mcq.c void ufshcd_mcq_write_cqis(struct ufs_hba *hba, u32 val, int i) · line 280

Quoted 9 lines
drivers/ufs/core/ufs-mcq.c +3 -1
@@ -273,13 +273,18 @@ void ufshcd_mcq_write_cqis(struct ufs_hba *hba, u32 val, int i)
  EXPORT_SYMBOL_GPL(ufshcd_mcq_write_cqis);
 
  /*
- * Current MCQ specification doesn't provide a Task Tag or its equivalent in
+ * UFS 4.0 MCQ specification doesn't provide a Task Tag or its equivalent in
   * the Completion Queue Entry. Find the Task Tag using an indirect method.
+ * UFS 4.1 and above can directly return the Task Tag in the Completion Queue
+ * Entry.
   */

UFS -> UFSHCI

Otherwise this patch looks good to me.

Thanks,

Bart.

#2 lore raw
Quoted 7 lines · Bart Van Assche

UFS -> UFSHCI

Otherwise this patch looks good to me.

Thanks,

Bart.

Hi Bart,

OK, I will make it clearer in the next version.
By the way, do you think it would be appropriate to create another patch to change hba->ufs_version to hba->ufshci_version?

Thanks.
Peter

#3 lore raw
Quoted 2 lines · Peter Wang (王信友)

By the way, do you think it would be appropriate to create another patch to change hba->ufs_version to hba->ufshci_version?

Hi Peter,

I think that would be a welcome improvement.

Thanks,

Bart.