]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: ufs: core: Use a host-wide tagset in SDB mode
authorBart Van Assche <bvanassche@acm.org>
Fri, 16 Jan 2026 18:07:51 +0000 (10:07 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 4 Feb 2026 02:56:27 +0000 (21:56 -0500)
In single-doorbell (SDB) mode there is only a single request queue. Hence,
it doesn't matter whether or not the SCSI host tagset is configured as
host-wide. Configure the host tagset as host-wide in SDB mode because this
enables a simplification of the hot path.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Link: https://patch.msgid.link/20260116180800.3085233-1-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufs-mcq.c
drivers/ufs/core/ufshcd-priv.h
drivers/ufs/core/ufshcd.c

index 64c234096e23106a1d1f45e43df14aece4629ad4..18a95b728633ffca338de150cbff102009b7e560 100644 (file)
@@ -444,7 +444,6 @@ EXPORT_SYMBOL_GPL(ufshcd_mcq_config_esi);
 
 int ufshcd_mcq_init(struct ufs_hba *hba)
 {
-       struct Scsi_Host *host = hba->host;
        struct ufs_hw_queue *hwq;
        int ret, i;
 
@@ -478,7 +477,6 @@ int ufshcd_mcq_init(struct ufs_hba *hba)
                mutex_init(&hwq->sq_mutex);
        }
 
-       host->host_tagset = 1;
        return 0;
 }
 
index 4259f499382fae904a4a737d56be3e2eb2b15fb8..7d6d19361af93590f04dc8a393b64267be66f58d 100644 (file)
@@ -374,12 +374,7 @@ 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)
 {
-       /*
-        * 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 blk_mq_tags *tags = hba->host->tag_set.shared_tags;
        struct request *rq = blk_mq_tag_to_rq(tags, tag);
 
        if (WARN_ON_ONCE(!rq))
index 0369043ca010efb447290691b44101e38ff85fb8..66223d290853202f6971fc897ae9c89109d12d1e 100644 (file)
@@ -9321,6 +9321,7 @@ static const struct scsi_host_template ufshcd_driver_template = {
        .max_segment_size       = PRDT_DATA_BYTE_COUNT_MAX,
        .max_sectors            = SZ_1M / SECTOR_SIZE,
        .max_host_blocked       = 1,
+       .host_tagset            = true,
        .track_queue_depth      = 1,
        .skip_settle_delay      = 1,
        .sdev_groups            = ufshcd_driver_groups,