[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250421135123.594-1-tanghuan@vivo.com>
Date: Mon, 21 Apr 2025 21:51:23 +0800
From: Huan Tang <tanghuan@...o.com>
To: alim.akhtar@...sung.com,
avri.altman@....com,
bvanassche@....org,
James.Bottomley@...senPartnership.com,
martin.petersen@...cle.com,
peter.wang@...iatek.com,
manivannan.sadhasivam@...aro.org,
quic_nguyenb@...cinc.com,
ebiggers@...gle.com,
minwoo.im@...sung.com,
linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com,
Huan Tang <tanghuan@...o.com>
Subject: [PATCH] ufs: core: add caps UFSHCD_CAP_MCQ_EN
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@...o.com>
---
drivers/ufs/core/ufshcd.c | 3 ++-
include/ufs/ufshcd.h | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 44156041d88f..b8937f85d81a 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -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);
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index e928ed0265ff..d8547bc6bf79 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -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 {
--
2.39.0
Powered by blists - more mailing lists