[<prev] [next>] [day] [month] [year] [list]
Message-ID: <c3af1d940d8a0d679281019e690c48506b8d29f3.1663894792.git.quic_asutoshd@quicinc.com>
Date: Thu, 22 Sep 2022 18:05:16 -0700
From: Asutosh Das <quic_asutoshd@...cinc.com>
To: <mani@...nel.org>, <quic_nguyenb@...cinc.com>,
<quic_xiaosenh@...cinc.com>, <quic_cang@...cinc.com>,
<quic_nitirawa@...cinc.com>, <quic_rampraka@...cinc.com>,
<quic_richardp@...cinc.com>, <stanley.chu@...iatek.com>,
<adrian.hunter@...el.com>, <bvanassche@....org>,
<avri.altman@....com>, <beanhuo@...ron.com>,
<martin.petersen@...cle.com>
CC: <linux-scsi@...r.kernel.org>,
Asutosh Das <quic_asutoshd@...cinc.com>,
Alim Akhtar <alim.akhtar@...sung.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
Matthias Brugger <matthias.bgg@...il.com>,
open list <linux-kernel@...r.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-arm-kernel@...ts.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>
Subject: [PATCH v1 09/16] ufs: core: mcq: Use shared tags for MCQ mode
Enable shared taggs for MCQ. For UFS, this should
not have a huge performance impact. It however
simplifies the MCQ implementation and reuses most of
the existing code in the issue and completion path.
Also add multiple queue mapping to map_queue().
Co-developed-by: Can Guo <quic_cang@...cinc.com>
Signed-off-by: Can Guo <quic_cang@...cinc.com>
Signed-off-by: Asutosh Das <quic_asutoshd@...cinc.com>
---
drivers/ufs/core/ufs-mcq.c | 2 ++
drivers/ufs/core/ufshcd.c | 31 +++++++++++++++++--------------
2 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
index 7e57e7e..d40b237 100644
--- a/drivers/ufs/core/ufs-mcq.c
+++ b/drivers/ufs/core/ufs-mcq.c
@@ -383,6 +383,7 @@ int ufshcd_mcq_init(struct ufs_hba *hba)
{
int ret, i;
struct ufs_hw_queue *hwq;
+ struct Scsi_Host *host = hba->host;
ret = ufshcd_mcq_config_nr_queues(hba);
if (ret)
@@ -416,6 +417,7 @@ int ufshcd_mcq_init(struct ufs_hba *hba)
/* Give dev_cmd_queue the minimal number of entries */
hba->dev_cmd_queue->max_entries = 2;
+ host->host_tagset = 1;
return 0;
}
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index b1af85c..6d70065 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -2719,25 +2719,28 @@ static inline bool is_device_wlun(struct scsi_device *sdev)
*/
static int ufshcd_map_queues(struct Scsi_Host *shost)
{
- int i, ret;
+ int i, queue_offset = 0;
+ struct ufs_hba *hba = shost_priv(shost);
+
+ if (!is_mcq_supported(hba)) {
+ hba->nr_queues[HCTX_TYPE_DEFAULT] = 1;
+ hba->nr_queues[HCTX_TYPE_READ] = 0;
+ hba->nr_queues[HCTX_TYPE_POLL] = 1;
+ hba->nr_hw_queues = 1;
+ }
for (i = 0; i < shost->nr_maps; i++) {
struct blk_mq_queue_map *map = &shost->tag_set.map[i];
- switch (i) {
- case HCTX_TYPE_DEFAULT:
- case HCTX_TYPE_POLL:
- map->nr_queues = 1;
- break;
- case HCTX_TYPE_READ:
- map->nr_queues = 0;
+ map->nr_queues = hba->nr_queues[i];
+ if (!map->nr_queues)
continue;
- default:
- WARN_ON_ONCE(true);
- }
- map->queue_offset = 0;
- ret = blk_mq_map_queues(map);
- WARN_ON_ONCE(ret);
+ map->queue_offset = queue_offset;
+ if (i == HCTX_TYPE_POLL && !is_mcq_supported(hba))
+ map->queue_offset = 0;
+
+ blk_mq_map_queues(map);
+ queue_offset += map->nr_queues;
}
return 0;
--
2.7.4
Powered by blists - more mailing lists