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

Commit 258fdfc0 authored by Sivan Reinstein's avatar Sivan Reinstein
Browse files

msm: ipa: remove ipa clock proxy vote after uC loading is complete



This change resolves a case where the IPA clock proxy vote is
removed too early (when QMI handshake is complete) while uC loading
indication hasn't been received yet. In this case, it is possible
that IPA will go to clock gating / power collapse, and upon receiving
a "uC loaded" event, the shared memory contents will be empty (all zeroes)
and the driver will miss the indication.

CRs-Fixed: 863218
Change-Id: I82071a9f9f2d5e876cd5227215491519ea906f24
Signed-off-by: default avatarSivan Reinstein <sivanr@codeaurora.org>
Acked-by: default avatarDavid Arinzon <darinzon@qti.qualcomm.com>
parent 7d54fbdb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -790,7 +790,7 @@ static void ipa_q6_clnt_svc_arrive(struct work_struct *work)
		return;
	}
	qmi_modem_init_fin = true;
	ipa2_proxy_clk_unvote();

	/* is_load_uc=FALSE indicates that SSR has occurred */
	ipa_q6_handshake_complete(!is_load_uc);
	IPAWANDBG("complete, qmi_modem_init_fin : %d\n",
+5 −0
Original line number Diff line number Diff line
@@ -442,6 +442,11 @@ static void ipa_uc_response_hdlr(enum ipa_irq_type interrupt,
			IPA_HW_2_CPU_RESPONSE_INIT_COMPLETED) {
		ipa_ctx->uc_ctx.uc_loaded = true;
		IPAERR("IPA uC loaded\n");
		/*
		 * The proxy vote is held until uC is loaded to ensure that
		 * IPA_HW_2_CPU_RESPONSE_INIT_COMPLETED is received.
		 */
		ipa2_proxy_clk_unvote();
		for (i = 0; i < IPA_HW_NUM_FEATURES; i++) {
			if (uc_hdlrs[i].ipa_uc_loaded_hdlr)
				uc_hdlrs[i].ipa_uc_loaded_hdlr();
+15 −1
Original line number Diff line number Diff line
@@ -2449,9 +2449,23 @@ void ipa_broadcast_quota_reach_ind(u32 mux_id)
void ipa_q6_handshake_complete(bool ssr_bootup)
{
	/* It is required to recover the network stats after SSR recovery */
	if (ssr_bootup)
	if (ssr_bootup) {
		/*
		 * In case the uC is required to be loaded by the Modem,
		 * the proxy vote will be removed only when uC loading is
		 * complete and indication is received by the AP. After SSR,
		 * uC is already loaded. Therefore, proxy vote can be removed
		 * once Modem init is complete.
		 */
		ipa2_proxy_clk_unvote();

		/*
		 * It is required to recover the network stats after
		 * SSR recovery
		 */
		rmnet_ipa_get_network_stats_and_update();
	}
}

static int __init ipa_wwan_init(void)
{
+1 −1
Original line number Diff line number Diff line
@@ -795,7 +795,7 @@ static void ipa3_q6_clnt_svc_arrive(struct work_struct *work)
		return;
	}
	ipa3_qmi_modem_init_fin = true;
	ipa3_proxy_clk_unvote();

	/* is_load_uc=FALSE indicates that SSR has occurred */
	ipa3_q6_handshake_complete(!is_load_uc);
	IPAWANDBG("complete, ipa3_qmi_modem_init_fin : %d\n",
+5 −0
Original line number Diff line number Diff line
@@ -420,6 +420,11 @@ static void ipa3_uc_response_hdlr(enum ipa_irq_type interrupt,
			IPA_HW_2_CPU_RESPONSE_INIT_COMPLETED) {
		ipa3_ctx->uc_ctx.uc_loaded = true;
		IPAERR("IPA uC loaded\n");
		/*
		 * The proxy vote is held until uC is loaded to ensure that
		 * IPA_HW_2_CPU_RESPONSE_INIT_COMPLETED is received.
		 */
		ipa3_proxy_clk_unvote();
		for (i = 0; i < IPA_HW_NUM_FEATURES; i++) {
			if (ipa3_uc_hdlrs[i].ipa_uc_loaded_hdlr)
				ipa3_uc_hdlrs[i].ipa_uc_loaded_hdlr();
Loading