scsi: ufs: core: Add reinit_notify() callback

reinit_notify() callback can be used by the UFS controller drivers to
perform changes required for UFSHCD reinit that can happen during max gear
switch.

Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Manivannan Sadhasivam 2022-12-22 19:39:56 +05:30 committed by Martin K. Petersen
parent 7959587f32
commit c2c38c573a
2 changed files with 8 additions and 0 deletions

View File

@ -223,6 +223,12 @@ static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
hba->vops->config_scaling_param(hba, p, data); hba->vops->config_scaling_param(hba, p, data);
} }
static inline void ufshcd_vops_reinit_notify(struct ufs_hba *hba)
{
if (hba->vops && hba->vops->reinit_notify)
hba->vops->reinit_notify(hba);
}
extern const struct ufs_pm_lvl_states ufs_pm_lvl_states[]; extern const struct ufs_pm_lvl_states ufs_pm_lvl_states[];
/** /**

View File

@ -298,6 +298,7 @@ struct ufs_pwr_mode_info {
* @config_scaling_param: called to configure clock scaling parameters * @config_scaling_param: called to configure clock scaling parameters
* @program_key: program or evict an inline encryption key * @program_key: program or evict an inline encryption key
* @event_notify: called to notify important events * @event_notify: called to notify important events
* @reinit_notify: called to notify reinit of UFSHCD during max gear switch
*/ */
struct ufs_hba_variant_ops { struct ufs_hba_variant_ops {
const char *name; const char *name;
@ -336,6 +337,7 @@ struct ufs_hba_variant_ops {
const union ufs_crypto_cfg_entry *cfg, int slot); const union ufs_crypto_cfg_entry *cfg, int slot);
void (*event_notify)(struct ufs_hba *hba, void (*event_notify)(struct ufs_hba *hba,
enum ufs_event_type evt, void *data); enum ufs_event_type evt, void *data);
void (*reinit_notify)(struct ufs_hba *);
}; };
/* clock gating state */ /* clock gating state */