@@ -112,7 +112,7 @@ static bool use_mcq_mode = true;
static bool is_mcq_supported(struct ufs_hba *hba)
{
- return hba->mcq_sup && use_mcq_mode;
+ return hba->mcq_sup && use_mcq_mode && (hba->caps & UFSHCD_CAP_MCQ_EN);
}
module_param(use_mcq_mode, bool, 0644);
@@ -10389,6 +10389,7 @@ int ufshcd_alloc_host(struct device *dev, struct ufs_hba **hba_handle)
hba->dev = dev;
hba->dev_ref_clk_freq = REF_CLK_FREQ_INVAL;
hba->nop_out_timeout = NOP_OUT_TIMEOUT;
+ hba->caps |= UFSHCD_CAP_MCQ_EN;
ufshcd_set_sg_entry_size(hba, sizeof(struct ufshcd_sg_entry));
INIT_LIST_HEAD(&hba->clk_list_head);
spin_lock_init(&hba->outstanding_lock);
@@ -771,6 +771,12 @@ enum ufshcd_caps {
* WriteBooster when scaling the clock down.
*/
UFSHCD_CAP_WB_WITH_CLK_SCALING = 1 << 12,
+
+ /*
+ * This capability allows the host controller driver to use the
+ * multi-circular queue, if it is present
+ */
+ UFSHCD_CAP_MCQ_EN = 1 << 13,
};
struct ufs_hba_variant_params {
Add caps UFSHCD_CAP_MCQ_EN(default enable), then host driver to control the on/off of MCQ; Sometimes, we don't want to enable MCQ and want to disable it through the host driver, for example, ufs-qcom.c . Signed-off-by: Huan Tang <tanghuan@vivo.com> --- drivers/ufs/core/ufshcd.c | 3 ++- include/ufs/ufshcd.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-)