[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230907073622.1731-1-luhongfei@vivo.com>
Date: Thu, 7 Sep 2023 15:35:48 +0800
From: Lu Hongfei <luhongfei@...o.com>
To: "Martin K. Petersen" <martin.petersen@...cle.com>,
Bart Van Assche <bvanassche@....org>,
Stanley Chu <stanley.chu@...iatek.com>,
Can Guo <quic_cang@...cinc.com>,
Manivannan Sadhasivam <mani@...nel.org>,
Asutosh Das <quic_asutoshd@...cinc.com>,
Po-Wen Kao <powen.kao@...iatek.com>,
Eric Biggers <ebiggers@...gle.com>,
Arthur Simchaev <Arthur.Simchaev@....com>,
Keoseong Park <keosung.park@...sung.com>,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com, luhongfei@...o.com
Subject: [PATCH 2/3] scsi: ufs: core: allow host driver to enable wb buffer resize function
Since UFS4.1 will support the WB buffer resize function, the host could
choose to enable or disable it as needed.
Introduce a flag UFSHCD_CAP_WB_BUF_RESIZE to provide the host with the
ability to enable or disable WB buffer resize function.
UFSHCD_CAP_WB_BUF_RESIZE is only valid when UFSHCD_CAP_WB_EN is set.
Signed-off-by: Lu Hongfei <luhongfei@...o.com>
---
include/ufs/ufshcd.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 7d07b256e906..7ea226b69e79 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -720,6 +720,13 @@ 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
+ * resize (increase or decrease) WriteBooster Buffer,
+ * if the underlying device supports it and is provisioned to be used.
+ */
+ UFSHCD_CAP_WB_BUF_RESIZE = 1 << 13,
};
struct ufs_hba_variant_params {
@@ -1193,6 +1200,11 @@ static inline bool ufshcd_is_wb_allowed(struct ufs_hba *hba)
return hba->caps & UFSHCD_CAP_WB_EN;
}
+static inline bool ufshcd_is_wb_buf_resize_allowed(struct ufs_hba *hba)
+{
+ return hba->caps & UFSHCD_CAP_WB_BUF_RESIZE;
+}
+
static inline bool ufshcd_enable_wb_if_scaling_up(struct ufs_hba *hba)
{
return hba->caps & UFSHCD_CAP_WB_WITH_CLK_SCALING;
--
2.39.0
Powered by blists - more mailing lists