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

Commit c165bdcd authored by Michael Adisumarta's avatar Michael Adisumarta Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: resume MHI Prime pipes for USB resume



Fix to resume MHI Prime pipes for USB resume with a prior suspend
with no remote wakeup.


Change-Id: Ib95eb07f1d62c78eaa4aca02f75dd59abe225076
Acked-by: default avatarJyothi J <jyothij@qti.qualcomm.com>
Signed-off-by: default avatarMichael Adisumarta <madisuma@codeaurora.org>
parent 33b7d3be
Loading
Loading
Loading
Loading
+30 −6
Original line number Diff line number Diff line
@@ -2050,7 +2050,7 @@ static int ipa3_usb_xdci_connect_internal(
	if (ipa3_is_mhip_offload_enabled()) {
		result = ipa_mpm_mhip_xdci_pipe_enable(params->teth_prot);
		if (result) {
			IPA_USB_ERR("failed to connect MHIP channel\n");
			IPA_USB_ERR("failed to enable MHIP channel\n");
			goto connect_teth_prot_fail;
		}
	}
@@ -2553,7 +2553,7 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
	if (ipa3_is_mhip_offload_enabled()) {
		result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot);
		if (result) {
			IPA_USB_ERR("failed to disconnect MHIP channel\n");
			IPA_USB_ERR("failed to disconnect MHIP pipe\n");
			goto bad_params;
		}
	}
@@ -2761,7 +2761,7 @@ static int ipa3_usb_suspend_no_remote_wakeup(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
	if (ipa3_is_mhip_offload_enabled()) {
		result = ipa_mpm_mhip_xdci_pipe_disable(teth_prot);
		if (result) {
			IPA_USB_ERR("failed to disconnect MHIP channel\n");
			IPA_USB_ERR("failed to disconnect MHIP pipe\n");
			goto start_ul;
		}
	}
@@ -2960,15 +2960,39 @@ static int ipa3_usb_resume_no_remote_wakeup(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
		goto stop_ul;
	}

	/* Start MHIP channel */
	if (ipa3_is_mhip_offload_enabled()) {
		if (!IPA3_USB_IS_TTYPE_DPL(ttype)) {
			/* Start UL MHIP channel */
			result = ipa_mpm_mhip_ul_start_stop_data(MPM_MHIP_START,
								teth_prot);
			if (result) {
				IPA_USB_ERR("fail UL MHIP Data Start\n");
				goto stop_dl;
			}
		}
		result = ipa_mpm_mhip_xdci_pipe_enable(teth_prot);
		if (result) {
			IPA_USB_ERR("failed to enable MHIP pipe\n");
			goto stop_mhip_data;
		}
	}
	/* Change state to CONNECTED */
	if (!ipa3_usb_set_state(IPA_USB_CONNECTED, false, ttype)) {
		IPA_USB_ERR("failed to change state to connected\n");
		result = -EFAULT;
		goto stop_dl;
		goto stop_mhip;
	}

	return 0;

stop_mhip:
	if (ipa3_is_mhip_offload_enabled())
		(void)ipa_mpm_mhip_xdci_pipe_disable(teth_prot);
stop_mhip_data:
	/* Stop UL MHIP data */
	if (ipa3_is_mhip_offload_enabled() && !IPA3_USB_IS_TTYPE_DPL(ttype))
		(void)ipa_mpm_mhip_ul_start_stop_data(MPM_MHIP_STOP,
							teth_prot);
stop_dl:
	(void)ipa3_xdci_disconnect(dl_clnt_hdl, false, -1);
stop_ul: