mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/3] scsi: ufs: core: allow host driver to enable wb buffer resize function
@ 2023-09-07  7:35 Lu Hongfei
  2023-09-07 13:45 ` Bart Van Assche
  0 siblings, 1 reply; 2+ messages in thread
From: Lu Hongfei @ 2023-09-07  7:35 UTC (permalink / raw)
  To: Martin K. Petersen, Bart Van Assche, Stanley Chu, Can Guo,
	Manivannan Sadhasivam, Asutosh Das, Po-Wen Kao, Eric Biggers,
	Arthur Simchaev, Keoseong Park, linux-kernel
  Cc: opensource.kernel, luhongfei

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/3] scsi: ufs: core: allow host driver to enable wb buffer resize function
  2023-09-07  7:35 [PATCH 2/3] scsi: ufs: core: allow host driver to enable wb buffer resize function Lu Hongfei
@ 2023-09-07 13:45 ` Bart Van Assche
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Van Assche @ 2023-09-07 13:45 UTC (permalink / raw)
  To: Lu Hongfei, Martin K. Petersen, Stanley Chu, Can Guo,
	Manivannan Sadhasivam, Asutosh Das, Po-Wen Kao, Eric Biggers,
	Arthur Simchaev, Keoseong Park, linux-kernel
  Cc: opensource.kernel

On 9/7/23 00:35, Lu Hongfei wrote:
> 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.

Please drop this patch. It should be sufficient that WB buffer resizing
can be controlled via sysfs. I don't think that the host driver should
be able to decide whether or not this functionality is enabled.

Additionally, when reposting this patch series, please include a cover
letter such that e-mail clients that support threading group these
patches into a series.

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-07 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-07  7:35 [PATCH 2/3] scsi: ufs: core: allow host driver to enable wb buffer resize function Lu Hongfei
2023-09-07 13:45 ` Bart Van Assche

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®