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

Commit 285907ab authored by Hemant Kumar's avatar Hemant Kumar
Browse files

mhi: core: Process bandwidth scaling event after force suspend



Bandwidth scaling event is handled by low priority worker. There
is a possibility of low priority worker racing with mission mode
state transition handling. This causes force suspend failure
because dev_wake count is incremented while processing bandwidth
scaling event. As a result l1ss timeout remains disabled and prevents
runtime suspend. Fix this issue by adding a flag to indicate force
suspend completion. This prevents processing of bandwidth scaling
event until force suspend is done. Bandwidth scaling events get
re-played after force suspend is done.

Change-Id: I0f2c415155842cab0449728dd136093be91f7259
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 041ae774
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1453,6 +1453,9 @@ int mhi_process_bw_scale_ev_ring(struct mhi_controller *mhi_cntrl,
		goto exit_no_lock;
	}

	if (mhi_cntrl->need_force_m3 && !mhi_cntrl->force_m3_done)
		goto exit_no_lock;

	ret = __mhi_device_get_sync(mhi_cntrl);
	if (ret)
		goto exit_no_lock;
+2 −0
Original line number Diff line number Diff line
@@ -634,6 +634,8 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl,
	flush_work(&mhi_cntrl->fw_worker);
	flush_work(&mhi_cntrl->low_priority_worker);

	mhi_cntrl->force_m3_done = false;

	if (sfr_info && sfr_info->buf_addr) {
		mhi_free_coherent(mhi_cntrl, sfr_info->len, sfr_info->buf_addr,
				  sfr_info->dma_addr);
+2 −0
Original line number Diff line number Diff line
@@ -380,6 +380,8 @@ struct mhi_controller {
	/* controller specific data */
	const char *name;
	bool power_down;
	bool need_force_m3;
	bool force_m3_done;
	void *priv_data;
	void *log_buf;
	struct dentry *dentry;