Skip to content

Commit c2c38c5

Browse files
Mani-Sadhasivammartinkpetersen
authored andcommitted
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>
1 parent 7959587 commit c2c38c5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/ufs/core/ufshcd-priv.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
223223
hba->vops->config_scaling_param(hba, p, data);
224224
}
225225

226+
static inline void ufshcd_vops_reinit_notify(struct ufs_hba *hba)
227+
{
228+
if (hba->vops && hba->vops->reinit_notify)
229+
hba->vops->reinit_notify(hba);
230+
}
231+
226232
extern const struct ufs_pm_lvl_states ufs_pm_lvl_states[];
227233

228234
/**

include/ufs/ufshcd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ struct ufs_pwr_mode_info {
298298
* @config_scaling_param: called to configure clock scaling parameters
299299
* @program_key: program or evict an inline encryption key
300300
* @event_notify: called to notify important events
301+
* @reinit_notify: called to notify reinit of UFSHCD during max gear switch
301302
*/
302303
struct ufs_hba_variant_ops {
303304
const char *name;
@@ -336,6 +337,7 @@ struct ufs_hba_variant_ops {
336337
const union ufs_crypto_cfg_entry *cfg, int slot);
337338
void (*event_notify)(struct ufs_hba *hba,
338339
enum ufs_event_type evt, void *data);
340+
void (*reinit_notify)(struct ufs_hba *);
339341
};
340342

341343
/* clock gating state */

0 commit comments

Comments
 (0)