From: Lu Hongfei <luhongfei@vivo.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
Bart Van Assche <bvanassche@acm.org>,
Stanley Chu <stanley.chu@mediatek.com>,
Can Guo <quic_cang@quicinc.com>,
Manivannan Sadhasivam <mani@kernel.org>,
Asutosh Das <quic_asutoshd@quicinc.com>,
Po-Wen Kao <powen.kao@mediatek.com>,
Eric Biggers <ebiggers@google.com>,
Arthur Simchaev <Arthur.Simchaev@wdc.com>,
Keoseong Park <keosung.park@samsung.com>,
linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com, luhongfei@vivo.com
Subject: [PATCH 2/3] scsi: ufs: core: allow host driver to enable wb buffer resize function
Date: Thu, 7 Sep 2023 15:35:48 +0800 [thread overview]
Message-ID: <20230907073622.1731-1-luhongfei@vivo.com> (raw)
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@vivo.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
next reply other threads:[~2023-09-07 15:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-07 7:35 Lu Hongfei [this message]
2023-09-07 13:45 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230907073622.1731-1-luhongfei@vivo.com \
--to=luhongfei@vivo.com \
--cc=Arthur.Simchaev@wdc.com \
--cc=bvanassche@acm.org \
--cc=ebiggers@google.com \
--cc=keosung.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=opensource.kernel@vivo.com \
--cc=powen.kao@mediatek.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_cang@quicinc.com \
--cc=stanley.chu@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®