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

Commit 4c6d6977 authored by Ravinder Konka's avatar Ravinder Konka
Browse files

msm: ipa: fix to system suspend



When there are no wakelocks acquired, system tries to go to
suspend. And if any of IPA pipes are in polling state,
system is not allowed go to suspend by IPA driver. As a result
system resumes its operation from suspend to full state and this
leads to bad power gains. Use a wakelock when any of the pipes
are in polling state to not to make the system go to suspend in
the first place. Release the wakelock when switching to interrupt mode.

Change-Id: I0dbfe5c65dceeb487955b130788890dec71a7efd
Acked-by: default avatarChaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: default avatarRavinder Konka <rkonka@codeaurora.org>
parent 2344e053
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3526,6 +3526,9 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p,
		goto fail_init_hw;
	}

	/* Create a wakeup source. */
	ipa_ctx->pdev->power.wakeup = wakeup_source_register("IPA_WS");

	/* Initialize IPA RM (resource manager) */
	result = ipa_rm_initialize();
	if (result) {
+4 −0
Original line number Diff line number Diff line
@@ -244,6 +244,7 @@ static void ipa_handle_tx(struct ipa_sys_context *sys)
	int cnt;

	ipa_inc_client_enable_clks();
	pm_stay_awake(ipa_ctx->pdev);
	do {
		cnt = ipa_handle_tx_core(sys, true, true);
		if (cnt == 0) {
@@ -256,6 +257,7 @@ static void ipa_handle_tx(struct ipa_sys_context *sys)
	} while (inactive_cycles <= POLLING_INACTIVITY_TX);

	ipa_tx_switch_to_intr_mode(sys);
	pm_relax(ipa_ctx->pdev);
	ipa_dec_client_disable_clks();
}

@@ -854,6 +856,7 @@ static void ipa_handle_rx(struct ipa_sys_context *sys)
	int cnt;

	ipa_inc_client_enable_clks();
	pm_stay_awake(ipa_ctx->pdev);
	do {
		cnt = ipa_handle_rx_core(sys, true, true);
		if (cnt == 0) {
@@ -874,6 +877,7 @@ static void ipa_handle_rx(struct ipa_sys_context *sys)
	} while (inactive_cycles <= POLLING_INACTIVITY_RX);

	ipa_rx_switch_to_intr_mode(sys);
	pm_relax(ipa_ctx->pdev);
	ipa_dec_client_disable_clks();
}