Re: [PATCH v5 09/16] ufs: core: mcq: Configure operation and runtime interface

From: Asutosh Das
Date: Mon Nov 28 2022 - 17:09:15 EST


On Fri, Nov 25 2022 at 17:28 -0800, Bart Van Assche wrote:
On 11/22/22 20:10, Asutosh Das wrote:
+static void ufshcd_config_mcq(struct ufs_hba *hba)
+{
+ ufshcd_enable_intr(hba, UFSHCD_ENABLE_MCQ_INTRS);
+ ufshcd_mcq_make_queues_operational(hba);
+ ufshcd_mcq_config_mac(hba, hba->nutrs);
+
+ hba->host->can_queue = hba->nutrs - UFSHCD_NUM_RESERVED;
+ hba->reserved_slot = hba->nutrs - UFSHCD_NUM_RESERVED;
+ dev_info(hba->dev, "MCQ configured, nr_queues=%d, io_queues=%d, read_queue=%d, poll_queues=%d, queue_depth=%d\n",
+ hba->nr_hw_queues, hba->nr_queues[HCTX_TYPE_DEFAULT],
+ hba->nr_queues[HCTX_TYPE_READ], hba->nr_queues[HCTX_TYPE_POLL],
+ hba->nutrs);
+}

Hello Bart,

Please do not reserve a slot for device commands in MCQ mode but instead queue device management commands on the device management command queue in MCQ mode. Please also add WARN_ON_ONCE() statements in the code that uses hba->reserved_slot to make sure that that variable is not used in MCQ mode.

Now it is queued to device management command queue in MCQ mode.
However, a task tag is needed for device management commands.
Do you mean that the task tag of device management command be default to 0
instead in MCQ mode?


Thanks,

Bart.