Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a417e459 authored by Kiwoong Kim's avatar Kiwoong Kim Committed by Greg Kroah-Hartman
Browse files

FROMLIST: ufs: introduce a callback to get info of command completion

Some SoC specific might need command history for
various reasons, such as stacking command contexts
in system memory to check for debugging in the future
or scaling some DVFS knobs to boost IO throughput.

What you would do with the information could be
variant per SoC vendor.

Bug: 163100341
Link: https://lore.kernel.org/linux-scsi/159530290480.22526.15318134249960762889.b4-ty@oracle.com/T/#t


Change-Id: I39a30ff742d3a2eebb66decb651e4cf5b990c1eb
Signed-off-by: default avatarKiwoong Kim <kwmad.kim@samsung.com>
Acked-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Reviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
parent 54413c42
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5103,6 +5103,7 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
	for_each_set_bit(index, &completed_reqs, hba->nutrs) {
		lrbp = &hba->lrb[index];
		cmd = lrbp->cmd;
		ufshcd_vops_compl_xfer_req(hba, index, (cmd) ? true : false);
		if (cmd) {
			ufshcd_add_command_trace(hba, index, "complete");
			result = ufshcd_transfer_rsp_status(hba, lrbp);
+8 −0
Original line number Diff line number Diff line
@@ -352,6 +352,7 @@ struct ufs_hba_variant_ops {
					struct ufs_pa_layer_attr *,
					struct ufs_pa_layer_attr *);
	void	(*setup_xfer_req)(struct ufs_hba *, int, bool);
	void	(*compl_xfer_req)(struct ufs_hba *hba, int tag, bool is_scsi);
	void	(*setup_task_mgmt)(struct ufs_hba *, int, u8);
	void    (*hibern8_notify)(struct ufs_hba *, enum uic_cmd_dme,
					enum ufs_notify_change_status);
@@ -1198,6 +1199,13 @@ static inline void ufshcd_vops_setup_xfer_req(struct ufs_hba *hba, int tag,
		return hba->vops->setup_xfer_req(hba, tag, is_scsi_cmd);
}

static inline void ufshcd_vops_compl_xfer_req(struct ufs_hba *hba,
					      int tag, bool is_scsi)
{
	if (hba->vops && hba->vops->compl_xfer_req)
		hba->vops->compl_xfer_req(hba, tag, is_scsi);
}

static inline void ufshcd_vops_setup_task_mgmt(struct ufs_hba *hba,
					int tag, u8 tm_function)
{