diff mbox series

[RESENT,RFC,v3,4/5] scsi: ufs: add unit and geometry parameters for HPB

Message ID 20200504142032.16619-5-beanhuo@micron.com (mailing list archive)
State Changes Requested
Headers show
Series scsi: ufs: add UFS Host Performance Booster(HPB) support | expand

Commit Message

Bean Huo May 4, 2020, 2:20 p.m. UTC
From: Bean Huo <beanhuo@micron.com>

Add HPB related parameters introduced in Unit Descriptor and
Geometry Descriptor.

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/scsi/ufs/ufs.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Bart Van Assche May 8, 2020, 1:04 a.m. UTC | #1
On 2020-05-04 07:20, huobean@gmail.com wrote:
> From: Bean Huo <beanhuo@micron.com>
> 
> Add HPB related parameters introduced in Unit Descriptor and
> Geometry Descriptor.
> 
> Signed-off-by: Bean Huo <beanhuo@micron.com>
> ---
>  drivers/scsi/ufs/ufs.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h
> index 1f2d4b4950b8..6210e489d2ce 100644
> --- a/drivers/scsi/ufs/ufs.h
> +++ b/drivers/scsi/ufs/ufs.h
> @@ -219,6 +219,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_PARAM_HPB_MAX_ACTIVE_REGIONS	= 0x23,
> +	UNIT_DESC_PARAM_HPB_PIN_REGION_START_OFFSET	= 0x25,
> +	UNIT_DESC_PARAM_HPB_NUM_PIN_REGIONS             = 0x27,
>  };
>  
>  /* Device descriptor parameters offsets in bytes*/
> @@ -304,6 +307,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_PARAM_HPB_REGION_SIZE	= 0x48,
> +	GEOMETRY_DESC_PARAM_HPB_NUMBER_LU	= 0x49,
> +	GEOMETRY_DESC_PARAM_HPB_SUBREGION_SIZE  = 0x4A,
> +	GEOMETRY_DESC_PARAM_HPB_MAX_ACTIVE_REGIONS = 0x4B,
>  };

How about adding the names from the spec as a comment above the new
constants, e.g. as follows?

	/* wHPBPinnedRegionStartIdx */
	UNIT_DESC_PARAM_HPB_PIN_REGION_START_OFFSET = 0x25,

Thanks,

Bart.
Bean Huo May 8, 2020, 10:15 a.m. UTC | #2
On Thu, 2020-05-07 at 18:04 -0700, Bart Van Assche wrote:
> > +     GEOMETRY_DESC_PARAM_HPB_REGION_SIZE     = 0x48,
> > +     GEOMETRY_DESC_PARAM_HPB_NUMBER_LU       = 0x49,
> > +     GEOMETRY_DESC_PARAM_HPB_SUBREGION_SIZE  = 0x4A,
> > +     GEOMETRY_DESC_PARAM_HPB_MAX_ACTIVE_REGIONS = 0x4B,
> >   };
> 
> How about adding the names from the spec as a comment above the new
> constants, e.g. as follows?
> 
>         /* wHPBPinnedRegionStartIdx */
>         UNIT_DESC_PARAM_HPB_PIN_REGION_START_OFFSET = 0x25,
> 
> Thanks,
> 
> Bart.

Bart
I will add in the next version.

thanks,

Bean
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h
index 1f2d4b4950b8..6210e489d2ce 100644
--- a/drivers/scsi/ufs/ufs.h
+++ b/drivers/scsi/ufs/ufs.h
@@ -219,6 +219,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_PARAM_HPB_MAX_ACTIVE_REGIONS	= 0x23,
+	UNIT_DESC_PARAM_HPB_PIN_REGION_START_OFFSET	= 0x25,
+	UNIT_DESC_PARAM_HPB_NUM_PIN_REGIONS             = 0x27,
 };
 
 /* Device descriptor parameters offsets in bytes*/
@@ -304,6 +307,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_PARAM_HPB_REGION_SIZE	= 0x48,
+	GEOMETRY_DESC_PARAM_HPB_NUMBER_LU	= 0x49,
+	GEOMETRY_DESC_PARAM_HPB_SUBREGION_SIZE  = 0x4A,
+	GEOMETRY_DESC_PARAM_HPB_MAX_ACTIVE_REGIONS = 0x4B,
 };
 
 /* Health descriptor parameters offsets in bytes*/