linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] ufs: core: Add WB buffer resize support
@ 2024-10-28 13:52 Huan Tang
  2024-10-28 19:50 ` Bart Van Assche
  0 siblings, 1 reply; 12+ messages in thread
From: Huan Tang @ 2024-10-28 13:52 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, bvanassche, James.Bottomley,
	martin.petersen, beanhuo, luhongfei, quic_cang, keosung.park,
	viro, quic_mnaresh, peter.wang, manivannan.sadhasivam, ahalaney,
	quic_nguyenb, linux, ebiggers, minwoo.im, linux-kernel,
	linux-scsi
  Cc: opensource.kernel, Huan Tang

Support WB buffer resize function through sysfs, the host can obtain
resize hint and resize status and enable the resize operation. To
achieve this goals, three sysfs nodes have been added:
	1. wb_toggle_buf_resize
	2. wb_buf_resize_hint
	3. wb_buf_resize_status

The detailed definition of the three nodes can be found in the sysfs
documentation.

Changelog
===
v2 - > v3:
	remove needless code:
	drivers/ufs/core/ufs-sysfs.c:441:2:
	index = ufshcd_wb_get_query_index(hba)

v1 - > v2:
	remove unused variable "u8 index",
	drivers/ufs/core/ufs-sysfs.c:419:12: warning: variable 'index'
	set but not used.

v1
	https://lore.kernel.org/all/20241025085924.4855-1-tanghuan@vivo.com/
v2
	https://lore.kernel.org/all/20241026004423.135-1-tanghuan@vivo.com/

Signed-off-by: Huan Tang <tanghuan@vivo.com>
Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
---
 Documentation/ABI/testing/sysfs-driver-ufs | 52 ++++++++++++++++++++++
 drivers/ufs/core/ufs-sysfs.c               | 42 +++++++++++++++++
 drivers/ufs/core/ufshcd.c                  | 15 +++++++
 include/ufs/ufs.h                          |  5 ++-
 include/ufs/ufshcd.h                       |  1 +
 5 files changed, 114 insertions(+), 1 deletion(-)

diff --git a/Documentation/ABI/testing/sysfs-driver-ufs b/Documentation/ABI/testing/sysfs-driver-ufs
index 5fa6655aee84..dbaa84277801 100644
--- a/Documentation/ABI/testing/sysfs-driver-ufs
+++ b/Documentation/ABI/testing/sysfs-driver-ufs
@@ -1559,3 +1559,55 @@ Description:
 		Symbol - HCMID. This file shows the UFSHCD manufacturer id.
 		The Manufacturer ID is defined by JEDEC in JEDEC-JEP106.
 		The file is read only.
+
+What:		/sys/bus/platform/drivers/ufshcd/*/wb_toggle_buf_resize
+What:		/sys/bus/platform/devices/*.ufs/wb_toggle_buf_resize
+Date:		Qct 2024
+Contact:	Huan Tang <tanghuan@vivo.com>
+Description:
+		The host can decrease or increase the WriteBooster Buffer size by setting
+		this file.
+
+		======  ======================================
+		00h  Idle (There is no resize operation)
+		01h  Decrease WriteBooster Buffer Size
+		02h  Increase WriteBooster Buffer Size
+		Others  Reserved
+		======  ======================================
+
+		The file is write only.
+
+What:		/sys/bus/platform/drivers/ufshcd/*/attributes/wb_buf_resize_hint
+What:		/sys/bus/platform/devices/*.ufs/attributes/wb_buf_resize_hint
+Date:		Qct 2024
+Contact:	Huan Tang <tanghuan@vivo.com>
+Description:
+		wb_buf_resize_hint indicates hint information about which type of resize for
+		WriteBooster Buffer is recommended by the device.
+
+		======  ======================================
+		00h  Recommend keep the buffer size
+		01h  Recommend to decrease the buffer size
+		02h  Recommend to increase the buffer size
+		Others: Reserved
+		======  ======================================
+
+		The file is read only.
+
+What:		/sys/bus/platform/drivers/ufshcd/*/attributes/wb_buf_resize_status
+What:		/sys/bus/platform/devices/*.ufs/attributes/wb_buf_resize_status
+Date:		Qct 2024
+Contact:	Huan Tang <tanghuan@vivo.com>
+Description:
+		The host can check the Resize operation status of the WriteBooster Buffer
+		by reading this file.
+
+		======  ========================================
+		00h  Idle (resize operation is not issued)
+		01h  Resize operation in progress
+		02h  Resize operation completed successfully
+		03h  Resize operation general failure
+		Others  Reserved
+		======  ========================================
+
+		The file is read only.
diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-sysfs.c
index 265f21133b63..683f916e558b 100644
--- a/drivers/ufs/core/ufs-sysfs.c
+++ b/drivers/ufs/core/ufs-sysfs.c
@@ -411,6 +411,42 @@ static ssize_t wb_flush_threshold_store(struct device *dev,
 	return count;
 }
 
+static ssize_t wb_toggle_buf_resize_store(struct device *dev,
+		struct device_attribute *attr, const char *buf, size_t count)
+{
+	struct ufs_hba *hba = dev_get_drvdata(dev);
+	unsigned int wb_buf_resize_op;
+	ssize_t res;
+
+	if (!ufshcd_is_wb_allowed(hba) || !hba->dev_info.wb_enabled ||
+		!hba->dev_info.b_presrv_uspc_en) {
+		dev_err(dev, "The WB buf resize is not allowed!\n");
+		return -EOPNOTSUPP;
+	}
+
+	if (kstrtouint(buf, 0, &wb_buf_resize_op))
+		return -EINVAL;
+
+	if (wb_buf_resize_op != 0x01 && wb_buf_resize_op != 0x02) {
+		dev_err(dev, "The operation %u is invalid!\n", wb_buf_resize_op);
+		return -EINVAL;
+	}
+
+	down(&hba->host_sem);
+	if (!ufshcd_is_user_access_allowed(hba)) {
+		res = -EBUSY;
+		goto out;
+	}
+
+	ufshcd_rpm_get_sync(hba);
+	res = ufshcd_wb_toggle_buf_resize(hba, wb_buf_resize_op);
+	ufshcd_rpm_put_sync(hba);
+
+out:
+	up(&hba->host_sem);
+	return res < 0 ? res : count;
+}
+
 /**
  * pm_qos_enable_show - sysfs handler to show pm qos enable value
  * @dev: device associated with the UFS controller
@@ -468,6 +504,7 @@ static DEVICE_ATTR_RW(auto_hibern8);
 static DEVICE_ATTR_RW(wb_on);
 static DEVICE_ATTR_RW(enable_wb_buf_flush);
 static DEVICE_ATTR_RW(wb_flush_threshold);
+static DEVICE_ATTR_WO(wb_toggle_buf_resize);
 static DEVICE_ATTR_RW(rtc_update_ms);
 static DEVICE_ATTR_RW(pm_qos_enable);
 
@@ -482,6 +519,7 @@ static struct attribute *ufs_sysfs_ufshcd_attrs[] = {
 	&dev_attr_wb_on.attr,
 	&dev_attr_enable_wb_buf_flush.attr,
 	&dev_attr_wb_flush_threshold.attr,
+	&dev_attr_wb_toggle_buf_resize.attr,
 	&dev_attr_rtc_update_ms.attr,
 	&dev_attr_pm_qos_enable.attr,
 	NULL
@@ -1526,6 +1564,8 @@ UFS_ATTRIBUTE(wb_flush_status, _WB_FLUSH_STATUS);
 UFS_ATTRIBUTE(wb_avail_buf, _AVAIL_WB_BUFF_SIZE);
 UFS_ATTRIBUTE(wb_life_time_est, _WB_BUFF_LIFE_TIME_EST);
 UFS_ATTRIBUTE(wb_cur_buf, _CURR_WB_BUFF_SIZE);
+UFS_ATTRIBUTE(wb_buf_resize_hint, _WB_BUF_RESIZE_HINT);
+UFS_ATTRIBUTE(wb_buf_resize_status, _WB_BUF_RESIZE_STATUS);
 
 
 static struct attribute *ufs_sysfs_attributes[] = {
@@ -1549,6 +1589,8 @@ static struct attribute *ufs_sysfs_attributes[] = {
 	&dev_attr_wb_avail_buf.attr,
 	&dev_attr_wb_life_time_est.attr,
 	&dev_attr_wb_cur_buf.attr,
+	&dev_attr_wb_buf_resize_hint.attr,
+	&dev_attr_wb_buf_resize_status.attr,
 	NULL,
 };
 
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 630409187c10..c28915debab6 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -6167,6 +6167,21 @@ static bool ufshcd_wb_need_flush(struct ufs_hba *hba)
 	return ufshcd_wb_presrv_usrspc_keep_vcc_on(hba, avail_buf);
 }
 
+int ufshcd_wb_toggle_buf_resize(struct ufs_hba *hba, u32 op)
+{
+	int ret;
+	u8 index;
+
+	index = ufshcd_wb_get_query_index(hba);
+	ret = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
+				   QUERY_ATTR_IDN_WB_BUF_RESIZE_EN, index, 0, &op);
+	if (ret)
+		dev_err(hba->dev, "%s: Enable WB buf resize operation failed %d\n",
+			__func__, ret);
+
+	return ret;
+}
+
 static void ufshcd_rpm_dev_flush_recheck_work(struct work_struct *work)
 {
 	struct ufs_hba *hba = container_of(to_delayed_work(work),
diff --git a/include/ufs/ufs.h b/include/ufs/ufs.h
index e594abe5d05f..f737d98044ac 100644
--- a/include/ufs/ufs.h
+++ b/include/ufs/ufs.h
@@ -181,7 +181,10 @@ enum attr_idn {
 	QUERY_ATTR_IDN_WB_BUFF_LIFE_TIME_EST    = 0x1E,
 	QUERY_ATTR_IDN_CURR_WB_BUFF_SIZE        = 0x1F,
 	QUERY_ATTR_IDN_EXT_IID_EN		= 0x2A,
-	QUERY_ATTR_IDN_TIMESTAMP		= 0x30
+	QUERY_ATTR_IDN_TIMESTAMP		= 0x30,
+	QUERY_ATTR_IDN_WB_BUF_RESIZE_HINT	= 0x3C,
+	QUERY_ATTR_IDN_WB_BUF_RESIZE_EN		= 0x3D,
+	QUERY_ATTR_IDN_WB_BUF_RESIZE_STATUS	= 0x3E,
 };
 
 /* Descriptor idn for Query requests */
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index a95282b9f743..cbe208ce9293 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -1454,6 +1454,7 @@ int ufshcd_advanced_rpmb_req_handler(struct ufs_hba *hba, struct utp_upiu_req *r
 				     struct scatterlist *sg_list, enum dma_data_direction dir);
 int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable);
 int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable);
+int ufshcd_wb_toggle_buf_resize(struct ufs_hba *hba, u32 op);
 int ufshcd_suspend_prepare(struct device *dev);
 int __ufshcd_suspend_prepare(struct device *dev, bool rpm_ok_for_spm);
 void ufshcd_resume_complete(struct device *dev);
-- 
2.39.0


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

* Re: [PATCH v3] ufs: core: Add WB buffer resize support
  2024-10-28 13:52 [PATCH v3] ufs: core: Add WB buffer resize support Huan Tang
@ 2024-10-28 19:50 ` Bart Van Assche
  2024-11-01  9:37   ` Huan Tang
  0 siblings, 1 reply; 12+ messages in thread
From: Bart Van Assche @ 2024-10-28 19:50 UTC (permalink / raw)
  To: Huan Tang, alim.akhtar, avri.altman, James.Bottomley,
	martin.petersen, beanhuo, luhongfei, quic_cang, keosung.park,
	viro, quic_mnaresh, peter.wang, manivannan.sadhasivam, ahalaney,
	quic_nguyenb, linux, ebiggers, minwoo.im, linux-kernel,
	linux-scsi
  Cc: opensource.kernel

On 10/28/24 6:52 AM, Huan Tang wrote:
> +What:		/sys/bus/platform/drivers/ufshcd/*/wb_toggle_buf_resize
> +What:		/sys/bus/platform/devices/*.ufs/wb_toggle_buf_resize
> +Date:		Qct 2024
> +Contact:	Huan Tang <tanghuan@vivo.com>
> +Description:
> +		The host can decrease or increase the WriteBooster Buffer size by setting
> +		this file.
> +
> +		======  ======================================
> +		00h  Idle (There is no resize operation)
> +		01h  Decrease WriteBooster Buffer Size
> +		02h  Increase WriteBooster Buffer Size
> +		Others  Reserved
> +		======  ======================================
> +
> +		The file is write only.

The name "wb_toggle_buf_resize" is not clear and will make users guess
what the purpose of this sysfs attribute is. Please choose a name that
is more clear, e.g. "wb_resize_action".

Additionally, please change the word "file" into "attribute" to maintain
consistency with the rest of the sysfs documentation.

Please also make sure that the documentation is consistent with the
code. The above documentation mentions the value 0 while the code
doesn't allow writing the value zero.

> +
> +What:		/sys/bus/platform/drivers/ufshcd/*/attributes/wb_buf_resize_status
> +What:		/sys/bus/platform/devices/*.ufs/attributes/wb_buf_resize_status
> +Date:		Qct 2024
> +Contact:	Huan Tang <tanghuan@vivo.com>
> +Description:
> +		The host can check the Resize operation status of the WriteBooster Buffer
> +		by reading this file.
> +
> +		======  ========================================
> +		00h  Idle (resize operation is not issued)
> +		01h  Resize operation in progress
> +		02h  Resize operation completed successfully
> +		03h  Resize operation general failure
> +		Others  Reserved
> +		======  ========================================

For the three new attributes: please use words in sysfs instead of 
numbers. Using numbers is not user-friendly.

> +static ssize_t wb_toggle_buf_resize_store(struct device *dev,
> +		struct device_attribute *attr, const char *buf, size_t count)
> +{
> +	struct ufs_hba *hba = dev_get_drvdata(dev);
> +	unsigned int wb_buf_resize_op;

Please introduce an enumeration type instead of using 'unsigned int'. 
Please also choose a more descriptive variable name than 'op'.

> +int ufshcd_wb_toggle_buf_resize(struct ufs_hba *hba, u32 op)
> +{
> +	int ret;
> +	u8 index;
> +
> +	index = ufshcd_wb_get_query_index(hba);
> +	ret = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
> +				   QUERY_ATTR_IDN_WB_BUF_RESIZE_EN, index, 0, &op);
> +	if (ret)
> +		dev_err(hba->dev, "%s: Enable WB buf resize operation failed %d\n",
> +			__func__, ret);
> +
> +	return ret;
> +}

This function doesn't toggle anything - it sets the value of the
bWriteBoosterBufferResizeEn attribute. Please reflect this in the
function name, e.g. by renaming this function into
ufshcd_wb_set_resize_en(). Additionally, the name of the 'op' argument
doesn't reflect the purpose of that argument. How about renaming it into
'enum wb_resize_en' where the wb_resize_en type support the three values
idle = 0, decrease = 1 and increase = 2?

Thanks,

Bart.

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

* Re: [PATCH v3] ufs: core: Add WB buffer resize support
  2024-10-28 19:50 ` Bart Van Assche
@ 2024-11-01  9:37   ` Huan Tang
  2024-11-01 16:23     ` Bart Van Assche
  0 siblings, 1 reply; 12+ messages in thread
From: Huan Tang @ 2024-11-01  9:37 UTC (permalink / raw)
  To: bvanassche
  Cc: huobean, cang, linux-scsi, opensource.kernel, richardp, tanghuan,
	luhongfei

> For the three new attributes: please use words in sysfs instead of 
> numbers. Using numbers is not user-friendly.


Hi Bart

Thank you for your reply! 
Thanks for your suggestions

I am confused about the above sentence and I don't understand it. Can you give me more detailed guidance?

v4
https://lore.kernel.org/all/20241101093318.825-1-tanghuan@vivo.com/

Thanks
Huan

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

* Re: [PATCH v3] ufs: core: Add WB buffer resize support
  2024-11-01  9:37   ` Huan Tang
@ 2024-11-01 16:23     ` Bart Van Assche
  2024-11-04 14:27       ` Huan Tang
  2025-04-11  9:29       ` [PATCH v11] " Huan Tang
  0 siblings, 2 replies; 12+ messages in thread
From: Bart Van Assche @ 2024-11-01 16:23 UTC (permalink / raw)
  To: Huan Tang
  Cc: huobean, cang, linux-scsi, opensource.kernel, richardp, luhongfei

On 11/1/24 2:37 AM, Huan Tang wrote:
>> For the three new attributes: please use words in sysfs instead of
>> numbers. Using numbers is not user-friendly.
> 
> 
> Hi Bart
> 
> Thank you for your reply!
> Thanks for your suggestions
> 
> I am confused about the above sentence and I don't understand it. Can you give me more detailed guidance?
> 
> v4
> https://lore.kernel.org/all/20241101093318.825-1-tanghuan@vivo.com/

Hi Huan,

Please modify the implementation of sysfs attributes like
wb_toggle_buf_resize such that a string is accepted (e.g. increase, 
decrease) instead of numbers (1, 2).

See also how sysfs_match_string() is used in e.g. drivers/scsi/sd.c.
Several sd sysfs attributes support writing a string into sysfs
attributes and that string is translated into a number.

Thanks,

Bart.

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

* Re: [PATCH v3] ufs: core: Add WB buffer resize support
  2024-11-01 16:23     ` Bart Van Assche
@ 2024-11-04 14:27       ` Huan Tang
  2024-11-04 17:28         ` Bart Van Assche
  2025-04-11  9:29       ` [PATCH v11] " Huan Tang
  1 sibling, 1 reply; 12+ messages in thread
From: Huan Tang @ 2024-11-04 14:27 UTC (permalink / raw)
  To: bvanassche
  Cc: huobean, cang, linux-scsi, opensource.kernel, richardp, tanghuan,
	luhongfei

> Hi Huan,

> Please modify the implementation of sysfs attributes like
> wb_toggle_buf_resize such that a string is accepted (e.g. increase, 
> decrease) instead of numbers (1, 2).
> 
> See also how sysfs_match_string() is used in e.g. drivers/scsi/sd.c.
> Several sd sysfs attributes support writing a string into sysfs
> attributes and that string is translated into a number.
> 
> Thanks,
> 
> Bart.

Hi Bart,

Thank you for your reply and guidance.
I got it.

I have submitted the v6 patch according to your suggestions.Could you
please review it again?

v6 patch:
https://lore.kernel.org/all/20241104142437.234-1-tanghuan@vivo.com/

Thanks
Huan

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

* Re: [PATCH v3] ufs: core: Add WB buffer resize support
  2024-11-04 14:27       ` Huan Tang
@ 2024-11-04 17:28         ` Bart Van Assche
  2024-11-05  2:31           ` Huan Tang
  0 siblings, 1 reply; 12+ messages in thread
From: Bart Van Assche @ 2024-11-04 17:28 UTC (permalink / raw)
  To: Huan Tang
  Cc: huobean, cang, linux-scsi, opensource.kernel, richardp, luhongfei

On 11/4/24 6:27 AM, Huan Tang wrote:
> I have submitted the v6 patch according to your suggestions.Could you
> please review it again?

The WB buffer resize functionality will be included in the JEDEC UFS 4.1
standard and that standard has not yet been published. Do the JEDEC
rules allow inclusion in the upstream kernel of functionality that has
not yet been published?

Thanks,

Bart.


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

* Re: [PATCH v3] ufs: core: Add WB buffer resize support
  2024-11-04 17:28         ` Bart Van Assche
@ 2024-11-05  2:31           ` Huan Tang
  0 siblings, 0 replies; 12+ messages in thread
From: Huan Tang @ 2024-11-05  2:31 UTC (permalink / raw)
  To: bvanassche
  Cc: cang, huobean, linux-scsi, luhongfei, opensource.kernel, richardp,
	tanghuan

> The WB buffer resize functionality will be included in the JEDEC UFS 4.1
> standard and that standard has not yet been published. Do the JEDEC
> rules allow inclusion in the upstream kernel of functionality that has
> not yet been published?


Hi Bart,

Thank you for your reply .
Sorry, my mistake; let's wait for JEDEC to officially release it before continuing the discussion

Thanks
Huan

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

* [PATCH v11] ufs: core: Add WB buffer resize support
  2024-11-01 16:23     ` Bart Van Assche
  2024-11-04 14:27       ` Huan Tang
@ 2025-04-11  9:29       ` Huan Tang
  2025-04-11 19:30         ` Bart Van Assche
                           ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: Huan Tang @ 2025-04-11  9:29 UTC (permalink / raw)
  To: bvanassche
  Cc: huobean, cang, linux-scsi, opensource.kernel, richardp, tanghuan,
	luhongfei

Follow JESD220G, Support WB buffer resize function through sysfs,
the host can obtain resize hint and resize status, and enable the
resize operation. To achieve this goals, three sysfs nodes have
been added:
	1. wb_resize_enable
	2. wb_resize_hint
	3. wb_resize_status
The detailed definition of the three nodes can be found in the sysfs
documentation.

Changelog
===
v10 - > v11:
	1.change "fail" to "failure", change "FAIL" to "FAILURE"
	2.fix coding style issue in "wb_resize_hint_show"
	and "wb_resize_status_show"
	3.remove ext_wb_sup sysfs node
	4.only use one tab in front of "="

v9 - > v10:
	fix commit message error:remove "^M"

v8 - > v9:
	1.Add "ext_wb_sup" node
	2.Fix some coding errors,for example: "gerneral" ->"general"
	3.Add a check bit0 of ext_wb_sup
	4.Following Bean's advice: use enum in ufshcd_wb_set_resize_en

v7 - > v8:
	1.Optimized the description in the sysfs-driver-ufs file
	2.Replace uppercase with lowercase, for example: "KEEP"-> "keep"
	3.Fix coding style issues with switch/case statements

v6 - > v7:
	1.Use "xxxx_to_string" for string convert
	2.Use uppercase characters, for example: "keep" -> "KEEP"
	3.Resize enable mode support "IDLE"

v5 - > v6:
	1.Fix mistake: obtain the return value of "sysfs_emit"

v4 - > v5:
	1.For the three new attributes: use words in sysfs instead of numbers

v3 - > v4:
	1.modify three attributes name and description in document
	2.add enum wb_resize_en in ufs.h
	3.modify function name and parameters in ufs-sysfs.c, ufshcd.h, ufshcd.c

v2 - > v3:
	Remove needless code:
	drivers/ufs/core/ufs-sysfs.c:441:2:
	index =	ufshcd_wb_get_query_index(hba)

v1 - > v2:
	Remove unused variable "u8 index",
	drivers/ufs/core/ufs-sysfs.c:419:12: warning: variable 'index'
	set but not used.

v1
	https://lore.kernel.org/all/20241025085924.4855-1-tanghuan@vivo.com/
v2
	https://lore.kernel.org/all/20241026004423.135-1-tanghuan@vivo.com/
v3
	https://lore.kernel.org/all/20241028135205.188-1-tanghuan@vivo.com/
v4
	https://lore.kernel.org/all/20241101093318.825-1-tanghuan@vivo.com/
v5
	https://lore.kernel.org/all/20241104134612.178-1-tanghuan@vivo.com/
v6
	https://lore.kernel.org/all/20241104142437.234-1-tanghuan@vivo.com/
v7
	https://lore.kernel.org/all/20250402014536.162-1-tanghuan@vivo.com/
v8
	https://lore.kernel.org/all/20250402075710.224-1-tanghuan@vivo.com/
v9
	https://lore.kernel.org/all/20250407085143.173-1-tanghuan@vivo.com/
v10
	https://lore.kernel.org/all/20250407090920.431-1-tanghuan@vivo.com/

Signed-off-by: Huan Tang <tanghuan@vivo.com>
Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
---
 Documentation/ABI/testing/sysfs-driver-ufs |  49 ++++++++
 drivers/ufs/core/ufs-sysfs.c               | 133 +++++++++++++++++++++
 drivers/ufs/core/ufshcd.c                  |  18 +++
 include/ufs/ufs.h                          |  34 +++++-
 include/ufs/ufshcd.h                       |   1 +
 5 files changed, 234 insertions(+), 1 deletion(-)

diff --git a/Documentation/ABI/testing/sysfs-driver-ufs b/Documentation/ABI/testing/sysfs-driver-ufs
index ae0191295d29..e7b49bc894f5 100644
--- a/Documentation/ABI/testing/sysfs-driver-ufs
+++ b/Documentation/ABI/testing/sysfs-driver-ufs
@@ -1604,3 +1604,52 @@ Description:
 		prevent the UFS from frequently performing clock gating/ungating.
 
 		The attribute is read/write.
+
+What:		/sys/bus/platform/drivers/ufshcd/*/wb_resize_enable
+What:		/sys/bus/platform/devices/*.ufs/wb_resize_enable
+Date:		April 2025
+Contact:	Huan Tang <tanghuan@vivo.com>
+Description:
+		The host can enable the WriteBooster buffer resize by setting this
+		attribute.
+
+		========  ======================================
+		idle      There is no resize operation
+		decrease  Decrease WriteBooster buffer size
+		increase  Increase WriteBooster buffer size
+		========  ======================================
+
+		The file is write only.
+
+What:		/sys/bus/platform/drivers/ufshcd/*/attributes/wb_resize_hint
+What:		/sys/bus/platform/devices/*.ufs/attributes/wb_resize_hint
+Date:		April 2025
+Contact:	Huan Tang <tanghuan@vivo.com>
+Description:
+		wb_resize_hint indicates hint information about which type of resize
+		for WriteBooster buffer is recommended by the device.
+
+		=========  ======================================
+		keep       Recommend keep the buffer size
+		decrease   Recommend to decrease the buffer size
+		increase   Recommend to increase the buffer size
+		=========  ======================================
+
+		The file is read only.
+
+What:		/sys/bus/platform/drivers/ufshcd/*/attributes/wb_resize_status
+What:		/sys/bus/platform/devices/*.ufs/attributes/wb_resize_status
+Date:		April 2025
+Contact:	Huan Tang <tanghuan@vivo.com>
+Description:
+		The host can check the resize operation status of the WriteBooster
+		buffer by reading this attribute.
+
+		================  ========================================
+		idle              Resize operation is not issued
+		in_progress       Resize operation in progress
+		complete_success  Resize operation completed successfully
+		general_failure   Resize operation general failure
+		================  ========================================
+
+		The file is read only.
diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-sysfs.c
index 90b5ab60f5ae..a27a3980480e 100644
--- a/drivers/ufs/core/ufs-sysfs.c
+++ b/drivers/ufs/core/ufs-sysfs.c
@@ -57,6 +57,36 @@ static const char *ufs_hs_gear_to_string(enum ufs_hs_gear_tag gear)
 	}
 }
 
+static const char *ufs_wb_resize_hint_to_string(enum wb_resize_hint hint)
+{
+	switch (hint) {
+	case WB_RESIZE_HINT_KEEP:
+		return "keep";
+	case WB_RESIZE_HINT_DECREASE:
+		return "decrease";
+	case WB_RESIZE_HINT_INCREASE:
+		return "increase";
+	default:
+		return "unknown";
+	}
+}
+
+static const char *ufs_wb_resize_status_to_string(enum wb_resize_status status)
+{
+	switch (status) {
+	case WB_RESIZE_STATUS_IDLE:
+		return "idle";
+	case WB_RESIZE_STATUS_IN_PROGRESS:
+		return "in_progress";
+	case WB_RESIZE_STATUS_COMPLETE_SUCCESS:
+		return "complete_success";
+	case WB_RESIZE_STATUS_GENERAL_FAILURE:
+		return "general_failure";
+	default:
+		return "unknown";
+	}
+}
+
 static const char *ufshcd_uic_link_state_to_string(
 			enum uic_link_state state)
 {
@@ -411,6 +441,44 @@ static ssize_t wb_flush_threshold_store(struct device *dev,
 	return count;
 }
 
+static const char * const wb_resize_en_mode[] = {
+	[WB_RESIZE_EN_IDLE]	= "idle",
+	[WB_RESIZE_EN_DECREASE]	= "decrease",
+	[WB_RESIZE_EN_INCREASE]	= "increase",
+};
+
+static ssize_t wb_resize_enable_store(struct device *dev,
+				struct device_attribute *attr,
+				const char *buf, size_t count)
+{
+	struct ufs_hba *hba = dev_get_drvdata(dev);
+	int mode;
+	ssize_t res;
+
+	if (!ufshcd_is_wb_allowed(hba) || !hba->dev_info.wb_enabled
+		|| !hba->dev_info.b_presrv_uspc_en
+		|| !(hba->dev_info.ext_wb_sup & UFS_DEV_WB_BUF_RESIZE))
+		return -EOPNOTSUPP;
+
+	mode = sysfs_match_string(wb_resize_en_mode, buf);
+	if (mode < 0)
+		return -EINVAL;
+
+	down(&hba->host_sem);
+	if (!ufshcd_is_user_access_allowed(hba)) {
+		res = -EBUSY;
+		goto out;
+	}
+
+	ufshcd_rpm_get_sync(hba);
+	res = ufshcd_wb_set_resize_en(hba, mode);
+	ufshcd_rpm_put_sync(hba);
+
+out:
+	up(&hba->host_sem);
+	return res < 0 ? res : count;
+}
+
 /**
  * pm_qos_enable_show - sysfs handler to show pm qos enable value
  * @dev: device associated with the UFS controller
@@ -476,6 +544,7 @@ static DEVICE_ATTR_RW(auto_hibern8);
 static DEVICE_ATTR_RW(wb_on);
 static DEVICE_ATTR_RW(enable_wb_buf_flush);
 static DEVICE_ATTR_RW(wb_flush_threshold);
+static DEVICE_ATTR_WO(wb_resize_enable);
 static DEVICE_ATTR_RW(rtc_update_ms);
 static DEVICE_ATTR_RW(pm_qos_enable);
 static DEVICE_ATTR_RO(critical_health);
@@ -491,6 +560,7 @@ static struct attribute *ufs_sysfs_ufshcd_attrs[] = {
 	&dev_attr_wb_on.attr,
 	&dev_attr_enable_wb_buf_flush.attr,
 	&dev_attr_wb_flush_threshold.attr,
+	&dev_attr_wb_resize_enable.attr,
 	&dev_attr_rtc_update_ms.attr,
 	&dev_attr_pm_qos_enable.attr,
 	&dev_attr_critical_health.attr,
@@ -1495,6 +1565,67 @@ static inline bool ufshcd_is_wb_attrs(enum attr_idn idn)
 		idn <= QUERY_ATTR_IDN_CURR_WB_BUFF_SIZE;
 }
 
+static int wb_read_resize_attrs(struct ufs_hba *hba,
+			enum attr_idn idn, u32 *attr_val)
+{
+	u8 index = 0;
+	int ret;
+
+	if (!ufshcd_is_wb_allowed(hba) || !hba->dev_info.wb_enabled
+		|| !hba->dev_info.b_presrv_uspc_en
+		|| !(hba->dev_info.ext_wb_sup & UFS_DEV_WB_BUF_RESIZE))
+		return -EOPNOTSUPP;
+
+	down(&hba->host_sem);
+	if (!ufshcd_is_user_access_allowed(hba)) {
+		up(&hba->host_sem);
+		return -EBUSY;
+	}
+
+	index = ufshcd_wb_get_query_index(hba);
+	ufshcd_rpm_get_sync(hba);
+	ret = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_READ_ATTR,
+			idn, index, 0, attr_val);
+	ufshcd_rpm_put_sync(hba);
+
+	up(&hba->host_sem);
+	return ret;
+}
+
+static ssize_t wb_resize_hint_show(struct device *dev,
+				struct device_attribute *attr, char *buf)
+{
+	struct ufs_hba *hba = dev_get_drvdata(dev);
+	int ret;
+	u32 value;
+
+	ret = wb_read_resize_attrs(hba,
+			QUERY_ATTR_IDN_WB_BUF_RESIZE_HINT, &value);
+	if (ret)
+		return ret;
+
+	return sysfs_emit(buf, "%s\n", ufs_wb_resize_hint_to_string(value));
+}
+
+static DEVICE_ATTR_RO(wb_resize_hint);
+
+static ssize_t wb_resize_status_show(struct device *dev,
+				struct device_attribute *attr, char *buf)
+{
+	struct ufs_hba *hba = dev_get_drvdata(dev);
+	int ret;
+	u32 value;
+
+	ret = wb_read_resize_attrs(hba,
+			QUERY_ATTR_IDN_WB_BUF_RESIZE_STATUS, &value);
+	if (ret)
+		return ret;
+
+	return sysfs_emit(buf, "%s\n", ufs_wb_resize_status_to_string(value));
+}
+
+static DEVICE_ATTR_RO(wb_resize_status);
+
 #define UFS_ATTRIBUTE(_name, _uname)					\
 static ssize_t _name##_show(struct device *dev,				\
 	struct device_attribute *attr, char *buf)			\
@@ -1568,6 +1699,8 @@ static struct attribute *ufs_sysfs_attributes[] = {
 	&dev_attr_wb_avail_buf.attr,
 	&dev_attr_wb_life_time_est.attr,
 	&dev_attr_wb_cur_buf.attr,
+	&dev_attr_wb_resize_hint.attr,
+	&dev_attr_wb_resize_status.attr,
 	NULL,
 };
 
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 83b092cbb864..a73838062ddf 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -6068,6 +6068,21 @@ int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable)
 	return ret;
 }
 
+int ufshcd_wb_set_resize_en(struct ufs_hba *hba, enum wb_resize_en en_mode)
+{
+	int ret;
+	u8 index;
+
+	index = ufshcd_wb_get_query_index(hba);
+	ret = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
+				QUERY_ATTR_IDN_WB_BUF_RESIZE_EN, index, 0, &en_mode);
+	if (ret)
+		dev_err(hba->dev, "%s: Enable WB buf resize operation failed %d\n",
+			__func__, ret);
+
+	return ret;
+}
+
 static bool ufshcd_wb_presrv_usrspc_keep_vcc_on(struct ufs_hba *hba,
 						u32 avail_buf)
 {
@@ -8067,6 +8082,9 @@ static void ufshcd_wb_probe(struct ufs_hba *hba, const u8 *desc_buf)
 	 */
 	dev_info->wb_buffer_type = desc_buf[DEVICE_DESC_PARAM_WB_TYPE];
 
+	dev_info->ext_wb_sup =  get_unaligned_be16(desc_buf +
+						DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP);
+
 	dev_info->b_presrv_uspc_en =
 		desc_buf[DEVICE_DESC_PARAM_WB_PRESRV_USRSPC_EN];
 
diff --git a/include/ufs/ufs.h b/include/ufs/ufs.h
index 8a24ed59ec46..3f2b1772f9fd 100644
--- a/include/ufs/ufs.h
+++ b/include/ufs/ufs.h
@@ -180,7 +180,10 @@ enum attr_idn {
 	QUERY_ATTR_IDN_AVAIL_WB_BUFF_SIZE       = 0x1D,
 	QUERY_ATTR_IDN_WB_BUFF_LIFE_TIME_EST    = 0x1E,
 	QUERY_ATTR_IDN_CURR_WB_BUFF_SIZE        = 0x1F,
-	QUERY_ATTR_IDN_TIMESTAMP		= 0x30
+	QUERY_ATTR_IDN_TIMESTAMP		= 0x30,
+	QUERY_ATTR_IDN_WB_BUF_RESIZE_HINT	= 0x3C,
+	QUERY_ATTR_IDN_WB_BUF_RESIZE_EN		= 0x3D,
+	QUERY_ATTR_IDN_WB_BUF_RESIZE_STATUS	= 0x3E,
 };
 
 /* Descriptor idn for Query requests */
@@ -289,6 +292,7 @@ enum device_desc_param {
 	DEVICE_DESC_PARAM_PRDCT_REV		= 0x2A,
 	DEVICE_DESC_PARAM_HPB_VER		= 0x40,
 	DEVICE_DESC_PARAM_HPB_CONTROL		= 0x42,
+	DEVICE_DESC_PARAM_EXT_WB_SUP		= 0x4D,
 	DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP	= 0x4F,
 	DEVICE_DESC_PARAM_WB_PRESRV_USRSPC_EN	= 0x53,
 	DEVICE_DESC_PARAM_WB_TYPE		= 0x54,
@@ -383,6 +387,11 @@ enum {
 	UFSHCD_AMP		= 3,
 };
 
+/* Possible values for wExtendedWriteBoosterSupport */
+enum {
+	UFS_DEV_WB_BUF_RESIZE	= BIT(0),
+};
+
 /* Possible values for dExtendedUFSFeaturesSupport */
 enum {
 	UFS_DEV_HIGH_TEMP_NOTIF		= BIT(4),
@@ -454,6 +463,28 @@ enum ufs_ref_clk_freq {
 	REF_CLK_FREQ_INVAL	= -1,
 };
 
+/* bWriteBoosterBufferResizeEn attribute */
+enum wb_resize_en {
+	WB_RESIZE_EN_IDLE	= 0,
+	WB_RESIZE_EN_DECREASE	= 1,
+	WB_RESIZE_EN_INCREASE	= 2,
+};
+
+/* bWriteBoosterBufferResizeHint attribute */
+enum wb_resize_hint {
+	WB_RESIZE_HINT_KEEP	= 0,
+	WB_RESIZE_HINT_DECREASE	= 1,
+	WB_RESIZE_HINT_INCREASE	= 2,
+};
+
+/* bWriteBoosterBufferResizeStatus attribute */
+enum wb_resize_status {
+	WB_RESIZE_STATUS_IDLE	= 0,
+	WB_RESIZE_STATUS_IN_PROGRESS	= 1,
+	WB_RESIZE_STATUS_COMPLETE_SUCCESS	= 2,
+	WB_RESIZE_STATUS_GENERAL_FAILURE	= 3,
+};
+
 /* Query response result code */
 enum {
 	QUERY_RESULT_SUCCESS                    = 0x00,
@@ -578,6 +609,7 @@ struct ufs_dev_info {
 	bool    wb_buf_flush_enabled;
 	u8	wb_dedicated_lu;
 	u8      wb_buffer_type;
+	u16	ext_wb_sup;
 
 	bool	b_rpm_dev_flush_capable;
 	u8	b_presrv_uspc_en;
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index f56050ce9445..722307182630 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -1471,6 +1471,7 @@ int ufshcd_advanced_rpmb_req_handler(struct ufs_hba *hba, struct utp_upiu_req *r
 				     struct scatterlist *sg_list, enum dma_data_direction dir);
 int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable);
 int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable);
+int ufshcd_wb_set_resize_en(struct ufs_hba *hba, enum wb_resize_en en_mode);
 int ufshcd_suspend_prepare(struct device *dev);
 int __ufshcd_suspend_prepare(struct device *dev, bool rpm_ok_for_spm);
 void ufshcd_resume_complete(struct device *dev);
-- 
2.39.0


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

* Re: [PATCH v11] ufs: core: Add WB buffer resize support
  2025-04-11  9:29       ` [PATCH v11] " Huan Tang
@ 2025-04-11 19:30         ` Bart Van Assche
  2025-04-12  1:38         ` Martin K. Petersen
  2025-04-23  8:06         ` Peter Wang (王信友)
  2 siblings, 0 replies; 12+ messages in thread
From: Bart Van Assche @ 2025-04-11 19:30 UTC (permalink / raw)
  To: Huan Tang
  Cc: huobean, cang, linux-scsi, opensource.kernel, richardp, luhongfei

On 4/11/25 2:29 AM, Huan Tang wrote:
> Follow JESD220G, Support WB buffer resize function through sysfs,
> the host can obtain resize hint and resize status, and enable the
> resize operation. To achieve this goals, three sysfs nodes have
> been added:
> 	1. wb_resize_enable
> 	2. wb_resize_hint
> 	3. wb_resize_status
> The detailed definition of the three nodes can be found in the sysfs
> documentation.

Please do not use the git send-email --in-reply-to option when posting a
new version of a patch or a new version of a patch series - this may
cause patches to be overlooked. Since this patch looks fine to me:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

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

* Re: [PATCH v11] ufs: core: Add WB buffer resize support
  2025-04-11  9:29       ` [PATCH v11] " Huan Tang
  2025-04-11 19:30         ` Bart Van Assche
@ 2025-04-12  1:38         ` Martin K. Petersen
  2025-04-23  8:06         ` Peter Wang (王信友)
  2 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2025-04-12  1:38 UTC (permalink / raw)
  To: Huan Tang
  Cc: bvanassche, huobean, cang, linux-scsi, opensource.kernel,
	richardp, luhongfei


Huan,

> Follow JESD220G, Support WB buffer resize function through sysfs, the
> host can obtain resize hint and resize status, and enable the resize
> operation. To achieve this goals, three sysfs nodes have been added:

Applied to 6.16/scsi-staging, thanks!

-- 
Martin K. Petersen

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

* Re: [PATCH v11] ufs: core: Add WB buffer resize support
  2025-04-11  9:29       ` [PATCH v11] " Huan Tang
  2025-04-11 19:30         ` Bart Van Assche
  2025-04-12  1:38         ` Martin K. Petersen
@ 2025-04-23  8:06         ` Peter Wang (王信友)
  2025-04-23  8:26           ` Huan Tang
  2 siblings, 1 reply; 12+ messages in thread
From: Peter Wang (王信友) @ 2025-04-23  8:06 UTC (permalink / raw)
  To: tanghuan@vivo.com, bvanassche@acm.org
  Cc: linux-scsi@vger.kernel.org, luhongfei@vivo.com,
	opensource.kernel@vivo.com, huobean@gmail.com,
	cang@qti.qualcomm.com, richardp@quicinc.com

On Fri, 2025-04-11 at 17:29 +0800, Huan Tang wrote:
> 
> @@ -8067,6 +8082,9 @@ static void ufshcd_wb_probe(struct ufs_hba
> *hba, const u8 *desc_buf)
>  	 */
>  	dev_info->wb_buffer_type =
> desc_buf[DEVICE_DESC_PARAM_WB_TYPE];
>  
> +	dev_info->ext_wb_sup =  get_unaligned_be16(desc_buf +
> +						DEVICE_DESC_PARAM_EX
> T_UFS_FEATURE_SUP);
> +
> 


Hi Huan,

DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP seems to be incorrect. 
It should be DEVICE_DESC_PARAM_EXT_WB_SUP

Thanks.
Peter



>  	dev_info->b_presrv_uspc_en =
>  		desc_buf[DEVICE_DESC_PARAM_WB_PRESRV_USRSPC_EN];
>  
> diff --git a/include/ufs/ufs.h b/include/ufs/ufs.h
> index 8a24ed59ec46..3f2b1772f9fd 100644
> --- a/include/ufs/ufs.h
> +++ b/include/ufs/ufs.h
> @@ -180,7 +180,10 @@ enum attr_idn {
>  	QUERY_ATTR_IDN_AVAIL_WB_BUFF_SIZE       = 0x1D,
>  	QUERY_ATTR_IDN_WB_BUFF_LIFE_TIME_EST    = 0x1E,
>  	QUERY_ATTR_IDN_CURR_WB_BUFF_SIZE        = 0x1F,
> -	QUERY_ATTR_IDN_TIMESTAMP		= 0x30
> +	QUERY_ATTR_IDN_TIMESTAMP		= 0x30,
> +	QUERY_ATTR_IDN_WB_BUF_RESIZE_HINT	= 0x3C,
> +	QUERY_ATTR_IDN_WB_BUF_RESIZE_EN		= 0x3D,
> +	QUERY_ATTR_IDN_WB_BUF_RESIZE_STATUS	= 0x3E,
>  };
>  
>  /* Descriptor idn for Query requests */
> @@ -289,6 +292,7 @@ enum device_desc_param {
>  	DEVICE_DESC_PARAM_PRDCT_REV		= 0x2A,
>  	DEVICE_DESC_PARAM_HPB_VER		= 0x40,
>  	DEVICE_DESC_PARAM_HPB_CONTROL		= 0x42,
> +	DEVICE_DESC_PARAM_EXT_WB_SUP		= 0x4D,
>  	DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP	= 0x4F,
>  	DEVICE_DESC_PARAM_WB_PRESRV_USRSPC_EN	= 0x53,
>  	DEVICE_DESC_PARAM_WB_TYPE		= 0x54,
> @@ -383,6 +387,11 @@ enum {
>  	UFSHCD_AMP		= 3,
>  };
>  
> +/* Possible values for wExtendedWriteBoosterSupport */
> +enum {
> +	UFS_DEV_WB_BUF_RESIZE	= BIT(0),
> +};
> +
>  /* Possible values for dExtendedUFSFeaturesSupport */
>  enum {
>  	UFS_DEV_HIGH_TEMP_NOTIF		= BIT(4),
> @@ -454,6 +463,28 @@ enum ufs_ref_clk_freq {
>  	REF_CLK_FREQ_INVAL	= -1,
>  };
>  
> +/* bWriteBoosterBufferResizeEn attribute */
> +enum wb_resize_en {
> +	WB_RESIZE_EN_IDLE	= 0,
> +	WB_RESIZE_EN_DECREASE	= 1,
> +	WB_RESIZE_EN_INCREASE	= 2,
> +};
> +
> +/* bWriteBoosterBufferResizeHint attribute */
> +enum wb_resize_hint {
> +	WB_RESIZE_HINT_KEEP	= 0,
> +	WB_RESIZE_HINT_DECREASE	= 1,
> +	WB_RESIZE_HINT_INCREASE	= 2,
> +};
> +
> +/* bWriteBoosterBufferResizeStatus attribute */
> +enum wb_resize_status {
> +	WB_RESIZE_STATUS_IDLE	= 0,
> +	WB_RESIZE_STATUS_IN_PROGRESS	= 1,
> +	WB_RESIZE_STATUS_COMPLETE_SUCCESS	= 2,
> +	WB_RESIZE_STATUS_GENERAL_FAILURE	= 3,
> +};
> +
>  /* Query response result code */
>  enum {
>  	QUERY_RESULT_SUCCESS                    = 0x00,
> @@ -578,6 +609,7 @@ struct ufs_dev_info {
>  	bool    wb_buf_flush_enabled;
>  	u8	wb_dedicated_lu;
>  	u8      wb_buffer_type;
> +	u16	ext_wb_sup;
>  
>  	bool	b_rpm_dev_flush_capable;
>  	u8	b_presrv_uspc_en;
> diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
> index f56050ce9445..722307182630 100644
> --- a/include/ufs/ufshcd.h
> +++ b/include/ufs/ufshcd.h
> @@ -1471,6 +1471,7 @@ int ufshcd_advanced_rpmb_req_handler(struct
> ufs_hba *hba, struct utp_upiu_req *r
>  				     struct scatterlist *sg_list,
> enum dma_data_direction dir);
>  int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable);
>  int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable);
> +int ufshcd_wb_set_resize_en(struct ufs_hba *hba, enum wb_resize_en
> en_mode);
>  int ufshcd_suspend_prepare(struct device *dev);
>  int __ufshcd_suspend_prepare(struct device *dev, bool
> rpm_ok_for_spm);
>  void ufshcd_resume_complete(struct device *dev);


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

* Re: Re: [PATCH v11] ufs: core: Add WB buffer resize support
  2025-04-23  8:06         ` Peter Wang (王信友)
@ 2025-04-23  8:26           ` Huan Tang
  0 siblings, 0 replies; 12+ messages in thread
From: Huan Tang @ 2025-04-23  8:26 UTC (permalink / raw)
  To: peter.wang
  Cc: bvanassche, cang, huobean, linux-scsi, luhongfei,
	opensource.kernel, richardp, tanghuan

> DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP seems to be incorrect. 
> It should be DEVICE_DESC_PARAM_EXT_WB_SUP


Hi peter sir,

Thanks for your reply and advice! 
I'll fix it right away

Best wishes to you !

Thanks
Huan

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

end of thread, other threads:[~2025-04-23  8:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-28 13:52 [PATCH v3] ufs: core: Add WB buffer resize support Huan Tang
2024-10-28 19:50 ` Bart Van Assche
2024-11-01  9:37   ` Huan Tang
2024-11-01 16:23     ` Bart Van Assche
2024-11-04 14:27       ` Huan Tang
2024-11-04 17:28         ` Bart Van Assche
2024-11-05  2:31           ` Huan Tang
2025-04-11  9:29       ` [PATCH v11] " Huan Tang
2025-04-11 19:30         ` Bart Van Assche
2025-04-12  1:38         ` Martin K. Petersen
2025-04-23  8:06         ` Peter Wang (王信友)
2025-04-23  8:26           ` Huan Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).