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

Commit 9b8eaf0b authored by Ravinder Konka's avatar Ravinder Konka
Browse files

msm: ipa: discard holb mitigation on Q6 pipes in ssr



When modem is shutdown, Q6 pipes are reset through uc.
As pipes are reset, holb mitigation logic kicks in
and ep_delay is set on all consumer pipes. At this point
if USB data transfer is going on and if USB is disconnected
IPA will not consume packets from USB and this results in
a forced crash. Make changes to discard holb monitoring on
Q6 pipes when modem is shutdown and enable back when QMI
handshake is completed. This will ensure holb monitoring
will not kick in when pipes are resetted.

Change-Id: Iaed23bb61b43eceef36c1fc5d264825d55e7268f
Acked-by: default avatarChaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: default avatarRavinder Konka <rkonka@codeaurora.org>
parent 299f19c3
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -1382,6 +1382,26 @@ static int ipa_q6_pipe_delay(bool zip_pipes)
	return 0;
}

int ipa_q6_monitor_holb_mitigation(bool enable)
{
	int ep_idx;
	int client_idx;

	for (client_idx = 0; client_idx < IPA_CLIENT_MAX; client_idx++) {
		if (IPA_CLIENT_IS_Q6_NON_ZIP_CONS(client_idx)) {
			ep_idx = ipa2_get_ep_mapping(client_idx);
			if (ep_idx == -1)
				continue;
			/* Send a command to Uc to enable/disable
			 * holb monitoring.
			 */
			ipa_uc_monitor_holb(client_idx, enable);
		}
	}

	return 0;
}

static int ipa_q6_avoid_holb(bool zip_pipes)
{
	u32 reg_val;
@@ -1720,6 +1740,12 @@ int ipa_q6_pre_shutdown_cleanup(void)
		IPAERR("Failed to delay Q6 pipes\n");
		BUG();
	}

	if (ipa_q6_monitor_holb_mitigation(false)) {
		IPAERR("Failed to disable HOLB monitroing on Q6 pipes\n");
		BUG();
	}

	if (ipa_q6_avoid_holb(false)) {
		IPAERR("Failed to set HOLB on Q6 pipes\n");
		BUG();
+1 −0
Original line number Diff line number Diff line
@@ -1943,6 +1943,7 @@ int ipa_tag_process(struct ipa_desc *desc, int num_descs,
int ipa_q6_pre_shutdown_cleanup(void);
int ipa_q6_post_shutdown_cleanup(void);
int ipa_init_q6_smem(void);
int ipa_q6_monitor_holb_mitigation(bool enable);

int ipa_sps_connect_safe(struct sps_pipe *h, struct sps_connect *connect,
			 enum ipa_client_type ipa_client);
+1 −10
Original line number Diff line number Diff line
@@ -751,7 +751,6 @@ int ipa_uc_monitor_holb(enum ipa_client_type ipa_client, bool enable)
	union IpaHwmonitorHolbCmdData_t cmd;
	int ep_idx;
	int ret;
	struct ipa_ep_context *ep;

	/* HOLB monitoring is applicable only to 2.6L. */
	if (ipa_ctx->ipa_hw_type != IPA_HW_v2_6L) {
@@ -765,14 +764,6 @@ int ipa_uc_monitor_holb(enum ipa_client_type ipa_client, bool enable)
		return 0;
	}

	ep = &ipa_ctx->ep[ep_idx];

	if (!ep->valid) {
		IPAERR("EP not valid.\n");
		return 0;
	}


	/*
	 * If the uC interface has not been initialized yet,
	 * continue with the sequence without resetting the
@@ -794,7 +785,7 @@ int ipa_uc_monitor_holb(enum ipa_client_type ipa_client, bool enable)
	cmd.params.monitorPipe = (u8)(enable ? 1 : 0);
	cmd.params.pipeNum = (u8)ep_idx;

	IPADBG("uC holb monitoring on IPA pipe %d\n, Enable: %d",
	IPADBG("uC holb monitoring on IPA pipe %d, Enable: %d\n",
	       ep_idx, enable);

	ret = ipa_uc_send_cmd(cmd.raw32b,
+3 −0
Original line number Diff line number Diff line
@@ -2689,6 +2689,9 @@ void ipa_q6_handshake_complete(bool ssr_bootup)
		 * SSR recovery
		 */
		rmnet_ipa_get_network_stats_and_update();

		/* Enable holb monitoring on Q6 pipes. */
		ipa_q6_monitor_holb_mitigation(true);
	}
}