diff mbox series

[v8,1/4] scsi: ufs: Add UFS feature related parameter

Message ID 231786897.01596705001840.JavaMail.epsvc@epcpadp1 (mailing list archive)
State Superseded
Headers show
Series scsi: ufs: Add Host Performance Booster Support | expand

Commit Message

Daejun Park Aug. 6, 2020, 9:02 a.m. UTC
This is a patch for parameters to be used for UFS feature and HPB
module.

Reviewed-by: Can Guo <cang@codeaurora.org>
Tested-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
---
 drivers/scsi/ufs/ufs.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Bart Van Assche Aug. 8, 2020, 11 p.m. UTC | #1
On 2020-08-06 02:02, Daejun Park wrote:
> @@ -537,6 +548,7 @@ struct ufs_dev_info {
>  	u8 *model;
>  	u16 wspecversion;
>  	u32 clk_gating_wait_us;
> +	u8 b_ufs_feature_sup;
>  	u32 d_ext_ufs_feature_sup;
>  	u8 b_wb_buffer_type;
>  	u32 d_wb_alloc_units;
> 

Hmm ... shouldn't this variable be introduced in the patch that introduces
the code that sets and uses this variable?

How about making it clear in the patch subject that this patch adds protocol
constants related to HPB?

Otherwise this patch looks good to me.

Bart.
Daejun Park Aug. 13, 2020, 2:16 a.m. UTC | #2
Hi Bart,

> On 2020-08-06 02:02, Daejun Park wrote:
> > @@ -537,6 +548,7 @@ struct ufs_dev_info {
> >      u8 *model;
> >      u16 wspecversion;
> >      u32 clk_gating_wait_us;
> > +    u8 b_ufs_feature_sup;
> >      u32 d_ext_ufs_feature_sup;
> >      u8 b_wb_buffer_type;
> >      u32 d_wb_alloc_units;
> > 
> 
> Hmm ... shouldn't this variable be introduced in the patch that introduces
> the code that sets and uses this variable?

OK, I will move this variable to 2/4 patch.

> How about making it clear in the patch subject that this patch adds protocol
> constants related to HPB?

The subject will be changed :
"Add UFS feature related parameter -> Adds constants related to HPB"
 
> Otherwise this patch looks good to me.
> 
> Bart.

Thanks,

Daejun
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h
index f8ab16f30fdc..ae557b8d3eba 100644
--- a/drivers/scsi/ufs/ufs.h
+++ b/drivers/scsi/ufs/ufs.h
@@ -122,6 +122,7 @@  enum flag_idn {
 	QUERY_FLAG_IDN_WB_EN                            = 0x0E,
 	QUERY_FLAG_IDN_WB_BUFF_FLUSH_EN                 = 0x0F,
 	QUERY_FLAG_IDN_WB_BUFF_FLUSH_DURING_HIBERN8     = 0x10,
+	QUERY_FLAG_IDN_HPB_RESET                        = 0x11,
 };
 
 /* Attribute idn for Query requests */
@@ -195,6 +196,9 @@  enum unit_desc_param {
 	UNIT_DESC_PARAM_PHY_MEM_RSRC_CNT	= 0x18,
 	UNIT_DESC_PARAM_CTX_CAPABILITIES	= 0x20,
 	UNIT_DESC_PARAM_LARGE_UNIT_SIZE_M1	= 0x22,
+	UNIT_DESC_HPB_LU_MAX_ACTIVE_REGIONS	= 0x23,
+	UNIT_DESC_HPB_LU_PIN_REGION_START_OFFSET	= 0x25,
+	UNIT_DESC_HPB_LU_NUM_PIN_REGIONS	= 0x27,
 	UNIT_DESC_PARAM_WB_BUF_ALLOC_UNITS	= 0x29,
 };
 
@@ -235,6 +239,8 @@  enum device_desc_param {
 	DEVICE_DESC_PARAM_PSA_MAX_DATA		= 0x25,
 	DEVICE_DESC_PARAM_PSA_TMT		= 0x29,
 	DEVICE_DESC_PARAM_PRDCT_REV		= 0x2A,
+	DEVICE_DESC_PARAM_HPB_VER		= 0x40,
+	DEVICE_DESC_PARAM_HPB_CONTROL		= 0x42,
 	DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP	= 0x4F,
 	DEVICE_DESC_PARAM_WB_PRESRV_USRSPC_EN	= 0x53,
 	DEVICE_DESC_PARAM_WB_TYPE		= 0x54,
@@ -283,6 +289,10 @@  enum geometry_desc_param {
 	GEOMETRY_DESC_PARAM_ENM4_MAX_NUM_UNITS	= 0x3E,
 	GEOMETRY_DESC_PARAM_ENM4_CAP_ADJ_FCTR	= 0x42,
 	GEOMETRY_DESC_PARAM_OPT_LOG_BLK_SIZE	= 0x44,
+	GEOMETRY_DESC_HPB_REGION_SIZE		= 0x48,
+	GEOMETRY_DESC_HPB_NUMBER_LU		= 0x49,
+	GEOMETRY_DESC_HPB_SUBREGION_SIZE	= 0x4A,
+	GEOMETRY_DESC_HPB_DEVICE_MAX_ACTIVE_REGIONS	= 0x4B,
 	GEOMETRY_DESC_PARAM_WB_MAX_ALLOC_UNITS	= 0x4F,
 	GEOMETRY_DESC_PARAM_WB_MAX_WB_LUNS	= 0x53,
 	GEOMETRY_DESC_PARAM_WB_BUFF_CAP_ADJ	= 0x54,
@@ -327,6 +337,7 @@  enum {
 
 /* Possible values for dExtendedUFSFeaturesSupport */
 enum {
+	UFS_DEV_HPB_SUPPORT		= BIT(7),
 	UFS_DEV_WRITE_BOOSTER_SUP	= BIT(8),
 };
 
@@ -537,6 +548,7 @@  struct ufs_dev_info {
 	u8 *model;
 	u16 wspecversion;
 	u32 clk_gating_wait_us;
+	u8 b_ufs_feature_sup;
 	u32 d_ext_ufs_feature_sup;
 	u8 b_wb_buffer_type;
 	u32 d_wb_alloc_units;