mbox series

[v2,0/3] scsi: ufs: core: support WB buffer resize function

Message ID 20230908102113.547-1-luhongfei@vivo.com
Headers show
Series scsi: ufs: core: support WB buffer resize function | expand

Message

Lu Hongfei Sept. 8, 2023, 10:20 a.m. UTC
Hello,

This v2 series implements the function of controlling the wb buffer resize
via sysfs that will be supported in UFS4.1.

The patch 1 add WB buffer resize related attr_idns.
The patch 2 Add ufshcd_wb_buf_resize function to enable WB buffer resize.
The patch 3 Add sysfs attributes to control WB buffer resize function.

version 2 changes
-Using sysfs to control WB buffer resize instead of exception event handler
-Removed content related to exception event
-Solved several issues that caused compilation errors

Of course, there may be better ways to implement this feature.
If necessary, please point it out and I will optimize it as soon as
possible.

As of now, there have been no UFS device releases that support this
feature, so I have not tested the code on real hardware.

------------------------------------------------------------------------

Lu Hongfei (3):
  scsi: ufs: core: add wb buffer resize related attr_idn
  scsi: ufs: core: Add ufshcd_wb_buf_resize function to enable WB buffer
    resize
  scsi: ufs: core: Add sysfs attributes to control WB buffer resize
    function

 Documentation/ABI/testing/sysfs-driver-ufs | 52 ++++++++++++++++
 drivers/ufs/core/ufs-sysfs.c               | 71 ++++++++++++++++++++++
 drivers/ufs/core/ufshcd-priv.h             |  1 +
 drivers/ufs/core/ufshcd.c                  | 21 +++++++
 include/ufs/ufs.h                          |  5 +-
 include/ufs/ufshcd.h                       |  1 +
 6 files changed, 150 insertions(+), 1 deletion(-)

Comments

Bart Van Assche Sept. 8, 2023, 3:31 p.m. UTC | #1
On 9/8/23 03:20, Lu Hongfei wrote:
> UFS4.1 will support the WB buffer resize function, and UFS driver needs
> to add definitions for attr_idn related to this function to support
> this feature

needs to -> can

Please also mention that the ballot for resizing the WriteBooster buffer 
has been approved.

> diff --git a/include/ufs/ufs.h b/include/ufs/ufs.h
> index 0cced88f4531..8016bf30c8c4 100644
> --- a/include/ufs/ufs.h
> +++ b/include/ufs/ufs.h
> @@ -179,7 +179,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

Please add a trailing comma after "0x3E".

Thanks,

Bart.
Can Guo Sept. 10, 2023, 1:56 a.m. UTC | #2
Hi Hongfei,

On 9/8/2023 6:20 PM, Lu Hongfei wrote:
> Hello,
>
> This v2 series implements the function of controlling the wb buffer resize
> via sysfs that will be supported in UFS4.1.
>
>
UFS4.1 JEDEC standard is targeting Q3 2024, before it is finalized, 
please don't put up changes for new features (which are still in draft) 
on upstream.


Thanks,

Can Guo.