Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag
@ 2026-02-10  7:17 peter.wang
  2026-02-10 10:10 ` Bean Huo
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: peter.wang @ 2026-02-10  7:17 UTC (permalink / raw)
  To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
  Cc: wsd_upstream, linux-mediatek, peter.wang, chun-hung.wu,
	alice.chao, cc.chou, chaotian.jing, tun-yu.yu, eddie.huang,
	naomi.chu, ed.tsai, bvanassche

From: Peter Wang <peter.wang@mediatek.com>

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

Signed-off-by: Peter Wang <peter.wang@mediatek.com>
---
 drivers/ufs/core/ufs-mcq.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
index ad0ada57959a..a4d0f8834314 100644
--- a/drivers/ufs/core/ufs-mcq.c
+++ b/drivers/ufs/core/ufs-mcq.c
@@ -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
+ * UFSHCI 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.
+ * UFSHCI 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));
 
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag
  2026-02-10  7:17 [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag peter.wang
@ 2026-02-10 10:10 ` Bean Huo
  2026-02-10 18:41 ` Bart Van Assche
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Bean Huo @ 2026-02-10 10:10 UTC (permalink / raw)
  To: peter.wang, linux-scsi, martin.petersen, avri.altman, alim.akhtar,
	jejb
  Cc: wsd_upstream, linux-mediatek, chun-hung.wu, alice.chao, cc.chou,
	chaotian.jing, tun-yu.yu, eddie.huang, naomi.chu, ed.tsai,
	bvanassche

On Tue, 2026-02-10 at 15:17 +0800, peter.wang@mediatek.com wrote:
> From: Peter Wang <peter.wang@mediatek.com>
> 
> The UFSHCI 4.1 specification introduces a new completion queue(CQ)
> entry format, allowing the tag to be obtained directly.
> 
> Signed-off-by: Peter Wang <peter.wang@mediatek.com>

Reviewed-by: Bean Huo <beanhuo@micron.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag
  2026-02-10  7:17 [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag peter.wang
  2026-02-10 10:10 ` Bean Huo
@ 2026-02-10 18:41 ` Bart Van Assche
  2026-02-24 18:42 ` Martin K. Petersen
  2026-02-28 22:22 ` Martin K. Petersen
  3 siblings, 0 replies; 6+ messages in thread
From: Bart Van Assche @ 2026-02-10 18:41 UTC (permalink / raw)
  To: peter.wang, linux-scsi, martin.petersen, avri.altman, alim.akhtar,
	jejb
  Cc: wsd_upstream, linux-mediatek, chun-hung.wu, alice.chao, cc.chou,
	chaotian.jing, tun-yu.yu, eddie.huang, naomi.chu, ed.tsai

On 2/9/26 11:17 PM, peter.wang@mediatek.com wrote:
> The UFSHCI 4.1 specification introduces a new completion queue(CQ)
> entry format, allowing the tag to be obtained directly.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag
  2026-02-10  7:17 [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag peter.wang
  2026-02-10 10:10 ` Bean Huo
  2026-02-10 18:41 ` Bart Van Assche
@ 2026-02-24 18:42 ` Martin K. Petersen
  2026-02-28 22:22 ` Martin K. Petersen
  3 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2026-02-24 18:42 UTC (permalink / raw)
  To: peter.wang
  Cc: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb,
	wsd_upstream, linux-mediatek, chun-hung.wu, alice.chao, cc.chou,
	chaotian.jing, tun-yu.yu, eddie.huang, naomi.chu, ed.tsai,
	bvanassche


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

Applied to 7.1/scsi-staging, thanks!

-- 
Martin K. Petersen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag
  2026-02-10  7:17 [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag peter.wang
                   ` (2 preceding siblings ...)
  2026-02-24 18:42 ` Martin K. Petersen
@ 2026-02-28 22:22 ` Martin K. Petersen
  2026-03-01  2:16   ` Martin K. Petersen
  3 siblings, 1 reply; 6+ messages in thread
From: Martin K. Petersen @ 2026-02-28 22:22 UTC (permalink / raw)
  To: linux-scsi, avri.altman, alim.akhtar, jejb, peter.wang
  Cc: Martin K . Petersen, wsd_upstream, linux-mediatek, chun-hung.wu,
	alice.chao, cc.chou, chaotian.jing, tun-yu.yu, eddie.huang,
	naomi.chu, ed.tsai, bvanassche

On Tue, 10 Feb 2026 15:17:30 +0800, peter.wang@mediatek.com wrote:

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

Applied to 7.1/scsi-queue, thanks!

[1/1] ufs: core: support UFSHCI 4.1 CQ entry tag
      https://git.kernel.org/mkp/scsi/c/f707860ebc84

-- 
Martin K. Petersen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag
  2026-02-28 22:22 ` Martin K. Petersen
@ 2026-03-01  2:16   ` Martin K. Petersen
  0 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2026-03-01  2:16 UTC (permalink / raw)
  To: linux-scsi, avri.altman, alim.akhtar, jejb, peter.wang
  Cc: Martin K . Petersen, wsd_upstream, linux-mediatek, chun-hung.wu,
	alice.chao, cc.chou, chaotian.jing, tun-yu.yu, eddie.huang,
	naomi.chu, ed.tsai, bvanassche

On Tue, 10 Feb 2026 15:17:30 +0800, peter.wang@mediatek.com wrote:

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

Applied to 7.1/scsi-queue, thanks!

[1/1] ufs: core: support UFSHCI 4.1 CQ entry tag
      https://git.kernel.org/mkp/scsi/c/f707860ebc84

-- 
Martin K. Petersen

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-01  2:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10  7:17 [PATCH v2] ufs: core: support UFSHCI 4.1 CQ entry tag peter.wang
2026-02-10 10:10 ` Bean Huo
2026-02-10 18:41 ` Bart Van Assche
2026-02-24 18:42 ` Martin K. Petersen
2026-02-28 22:22 ` Martin K. Petersen
2026-03-01  2:16   ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox