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

Commit 2850c316 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

mhi: core: Log time sync only in mission mode transition



Time sync logging requires a MHI register read which can block CPU
if MHI device is in retention. This results into blocking preemption
and irq on the core read was issued, because mhi_tryset_pm_state()
is called with write_lock_irq(). Fix the issue by moving time sync
logging into mission mode transition.

Change-Id: I5f1812f080ac101777ee6ea8e659c65700575c66
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent cc90763e
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -154,9 +154,6 @@ enum MHI_PM_STATE __must_check mhi_tryset_pm_state(
	MHI_VERB("Transition to pm state from:%s to:%s\n",
	MHI_VERB("Transition to pm state from:%s to:%s\n",
		 to_mhi_pm_state_str(cur_state), to_mhi_pm_state_str(state));
		 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;
	mhi_cntrl->pm_state = state;
	return mhi_cntrl->pm_state;
	return mhi_cntrl->pm_state;
}
}
@@ -507,6 +504,9 @@ static int mhi_pm_mission_mode_transition(struct mhi_controller *mhi_cntrl)
	/* setup support for time sync */
	/* setup support for time sync */
	mhi_init_timesync(mhi_cntrl);
	mhi_init_timesync(mhi_cntrl);


	if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state))
		mhi_timesync_log(mhi_cntrl);

	MHI_LOG("Adding new devices\n");
	MHI_LOG("Adding new devices\n");


	/* add supported devices */
	/* add supported devices */