diff mbox series

[v4,1/2] ufs: add a vops to configure block parameter

Message ID d937b2a64d597ce969ad3e36419f9814e5e202ae.1608689016.git.kwmad.kim@samsung.com (mailing list archive)
State Superseded
Headers show
Series permit to set block parameters per vendor | expand

Commit Message

Kiwoong Kim Dec. 23, 2020, 2:05 a.m. UTC
There could be some cases to set block parameters
per host, because of its own dma structure or whatever.

Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
---
 drivers/scsi/ufs/ufshcd.c | 2 ++
 drivers/scsi/ufs/ufshcd.h | 8 ++++++++
 2 files changed, 10 insertions(+)

Comments

Can Guo Dec. 23, 2020, 2:21 a.m. UTC | #1
On 2020-12-23 10:05, Kiwoong Kim wrote:
> There could be some cases to set block parameters
> per host, because of its own dma structure or whatever.
> 
> Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>

You missed my reviewed-by tag... Again, here it is

Reviewed-by: Can Guo <cang@codeaurora.org>

> ---
>  drivers/scsi/ufs/ufshcd.c | 2 ++
>  drivers/scsi/ufs/ufshcd.h | 8 ++++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 92d433d..5f89b0e 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -4758,6 +4758,8 @@ static int ufshcd_slave_configure(struct
> scsi_device *sdev)
> 
>  	ufshcd_crypto_setup_rq_keyslot_manager(hba, q);
> 
> +	ufshcd_vops_slave_configure(hba, sdev);
> +
>  	return 0;
>  }
> 
> diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
> index 61344c4..4bf4fed 100644
> --- a/drivers/scsi/ufs/ufshcd.h
> +++ b/drivers/scsi/ufs/ufshcd.h
> @@ -329,6 +329,7 @@ struct ufs_hba_variant_ops {
>  					void *data);
>  	int	(*program_key)(struct ufs_hba *hba,
>  			       const union ufs_crypto_cfg_entry *cfg, int slot);
> +	void	(*slave_configure)(struct scsi_device *sdev);
>  };
> 
>  /* clock gating state  */
> @@ -1228,6 +1229,13 @@ static inline void
> ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
>  		hba->vops->config_scaling_param(hba, profile, data);
>  }
> 
> +static inline void ufshcd_vops_slave_configure(struct ufs_hba *hba,
> +						    struct scsi_device *sdev)
> +{
> +	if (hba->vops && hba->vops->slave_configure)
> +		hba->vops->slave_configure(sdev);
> +}
> +
>  extern struct ufs_pm_lvl_states ufs_pm_lvl_states[];
> 
>  /*
Stanley Chu Dec. 23, 2020, 9:31 a.m. UTC | #2
On Wed, 2020-12-23 at 11:05 +0900, Kiwoong Kim wrote:
> There could be some cases to set block parameters
> per host, because of its own dma structure or whatever.
> 
> Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>

Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 92d433d..5f89b0e 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4758,6 +4758,8 @@  static int ufshcd_slave_configure(struct scsi_device *sdev)
 
 	ufshcd_crypto_setup_rq_keyslot_manager(hba, q);
 
+	ufshcd_vops_slave_configure(hba, sdev);
+
 	return 0;
 }
 
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 61344c4..4bf4fed 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -329,6 +329,7 @@  struct ufs_hba_variant_ops {
 					void *data);
 	int	(*program_key)(struct ufs_hba *hba,
 			       const union ufs_crypto_cfg_entry *cfg, int slot);
+	void	(*slave_configure)(struct scsi_device *sdev);
 };
 
 /* clock gating state  */
@@ -1228,6 +1229,13 @@  static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
 		hba->vops->config_scaling_param(hba, profile, data);
 }
 
+static inline void ufshcd_vops_slave_configure(struct ufs_hba *hba,
+						    struct scsi_device *sdev)
+{
+	if (hba->vops && hba->vops->slave_configure)
+		hba->vops->slave_configure(sdev);
+}
+
 extern struct ufs_pm_lvl_states ufs_pm_lvl_states[];
 
 /*