Skip to contentSkip to conversation

ufs: core: Fix single doorbell mode support

PATCH Applied Bart Van Assche 3 participants 4 messages Nov 14, 2025 – Nov 29, 2025

Subsystems (2)
lore
Share & tools
lore

Bart Van Assche

author reviewer
#0 lore raw

PATCH 1/1 ufs: core: Fix single doorbell mode support

Commit 22089c218037 ("scsi: ufs: core: Optimize the hot path") accidentally broke support for the legacy single doorbell mode. The tag_set.shared_tags pointer is only != NULL if shared tag support is enabled. The UFS driver only enables shared tag support in MCQ mode.

Fix this by handling legacy and MCQ modes differently in ufshcd_tag_to_cmd().

---
 drivers/ufs/core/ufshcd-priv.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd-priv.h +6 -1
index 2f752a45db87..676ebb02db8b 100644
@@ -368,7 +368,12 @@ static inline bool ufs_is_valid_unit_desc_lun(struct ufs_dev_info *dev_info, u8
  */
 static inline struct scsi_cmnd *ufshcd_tag_to_cmd(struct ufs_hba *hba, u32 tag)
 {
-	struct blk_mq_tags *tags = hba->host->tag_set.shared_tags;
+	/*
+	 * Host-wide tags are enabled in MCQ mode only. See also the
+	 * host->host_tagset assignment in ufs-mcq.c.
+	 */
+	struct blk_mq_tags *tags = hba->host->tag_set.shared_tags ?:
+					   hba->host->tag_set.tags[0];
 	struct request *rq = blk_mq_tag_to_rq(tags, tag);
 
 	if (WARN_ON_ONCE(!rq))
Tested-by on v1 1/1
#1 lore raw
Quoted 15 lines · Bart Van Assche

Commit 22089c218037 ("scsi: ufs: core: Optimize the hot path") accidentally broke support for the legacy single doorbell mode. The tag_set.shared_tags pointer is only != NULL if shared tag support is enabled. The UFS driver only enables shared tag support in MCQ mode.

Fix this by handling legacy and MCQ modes differently in ufshcd_tag_to_cmd().

Quoted 3 lines

---
 drivers/ufs/core/ufshcd-priv.h | 7 ++++++-

 1 file changed, 6 insertions(+), 1 deletion(-)

This fixes it for me on Pixel 6, too.

Thanks Bart for the quick fix!

#2 lore raw
In reply to Bart Van Assche

Bart,

Quoted 7 lines

Commit 22089c218037 ("scsi: ufs: core: Optimize the hot path") accidentally broke support for the legacy single doorbell mode. The tag_set.shared_tags pointer is only != NULL if shared tag support is enabled. The UFS driver only enables shared tag support in MCQ mode.

Fix this by handling legacy and MCQ modes differently in ufshcd_tag_to_cmd().

Applied to 6.19/scsi-staging, thanks!

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

Commit 22089c218037 ("scsi: ufs: core: Optimize the hot path") accidentally broke support for the legacy single doorbell mode. The tag_set.shared_tags pointer is only != NULL if shared tag support is enabled. The UFS driver only enables shared tag support in MCQ mode.

Fix this by handling legacy and MCQ modes differently in ufshcd_tag_to_cmd().

[...]

Applied to 6.19/scsi-queue, thanks!

[1/1] ufs: core: Fix single doorbell mode support

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