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

Commit c3894ffe authored by Sujeev Dias's avatar Sujeev Dias Committed by Sujeev Dias
Browse files

mhi: core: add time synchronized logs support



Whenever important events such as state changes occur on device,
it can help in debug to compare device timestamps and co-relate
those with host-side processing. Add support to log remote time
for these important events from MHI core layer.

CRs-Fixed: 2377061
Change-Id: Ieffd28e8049266e05a6c7397238083f02b2c095f
Acked-by: default avatarBhaumik Vasav Bhatt <bbhatt@qti.qualcomm.com>
Signed-off-by: default avatarSujeev Dias <sdias@codeaurora.org>
parent 57125fe0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -758,6 +758,16 @@ void mhi_destroy_timesync(struct mhi_controller *mhi_cntrl);
int mhi_create_vote_sysfs(struct mhi_controller *mhi_cntrl);
void mhi_destroy_vote_sysfs(struct mhi_controller *mhi_cntrl);

/* timesync log support */
static inline void mhi_timesync_log(struct mhi_controller *mhi_cntrl)
{
	struct mhi_timesync *mhi_tsync = mhi_cntrl->mhi_tsync;

	if (mhi_tsync && mhi_cntrl->tsync_log)
		mhi_cntrl->tsync_log(mhi_cntrl,
				     readq_no_log(mhi_tsync->time_reg));
}

/* memory allocation methods */
static inline void *mhi_alloc_coherent(struct mhi_controller *mhi_cntrl,
				       size_t size,
+3 −0
Original line number Diff line number Diff line
@@ -136,6 +136,9 @@ enum MHI_PM_STATE __must_check mhi_tryset_pm_state(
	MHI_VERB("Transition to pm state from:%s to:%s\n",
		 to_mhi_pm_state_str(cur_state), to_mhi_pm_state_str(state));

	if (MHI_REG_ACCESS_VALID(cur_state) || MHI_REG_ACCESS_VALID(state))
		mhi_timesync_log(mhi_cntrl);

	mhi_cntrl->pm_state = state;
	return mhi_cntrl->pm_state;
}
+1 −0
Original line number Diff line number Diff line
@@ -292,6 +292,7 @@ struct mhi_controller {
			  struct mhi_buf_info *buf);
	void (*unmap_single)(struct mhi_controller *mhi_cntrl,
			     struct mhi_buf_info *buf);
	void (*tsync_log)(struct mhi_controller *mhi_cntrl, u64 remote_time);

	/* channel to control DTR messaging */
	struct mhi_device *dtr_dev;