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

Commit 126cf366 authored by Skylar Chang's avatar Skylar Chang
Browse files

msm: ipa3: drain UL data for ECM/RNDIS tethering



In some cases modem will delay USB uplink pipe
for flow control. This will happen regardless of
tethering protocol. This change sends a QMI message
to modem to remove the delay on USB pipe in case
of USB cable disconnect.

CRs-Fixed: 1009199
Change-Id: I42cd716dcb87b814256a81418fecdff020f37d9d
Acked-by: default avatarAdy Abraham <adya@qti.qualcomm.com>
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
parent fdabe34a
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -2125,15 +2125,12 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
				flags);
			/* Stop UL channel */
			result = ipa3_xdci_disconnect(ul_clnt_hdl,
				(teth_prot == IPA_USB_RMNET ||
				teth_prot == IPA_USB_MBIM),
				true,
				ipa3_usb_ctx->qmi_req_id);
			if (result) {
				IPA_USB_ERR("failed disconnect UL channel\n");
				goto bad_params;
			}
			if (teth_prot == IPA_USB_RMNET ||
				teth_prot == IPA_USB_MBIM)
			ipa3_usb_ctx->qmi_req_id++;
		} else
			spin_unlock_irqrestore(&ipa3_usb_ctx->state_lock,
@@ -2363,15 +2360,12 @@ int ipa_usb_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl,

	/* Stop UL channel & suspend DL/DPL EP */
	result = ipa3_xdci_suspend(ul_clnt_hdl, dl_clnt_hdl,
		(teth_prot == IPA_USB_RMNET ||
		teth_prot == IPA_USB_MBIM),
		true,
		ipa3_usb_ctx->qmi_req_id, IPA3_USB_IS_TTYPE_DPL(ttype));
	if (result) {
		IPA_USB_ERR("failed to suspend\n");
		goto suspend_fail;
	}
	if (teth_prot == IPA_USB_RMNET ||
		teth_prot == IPA_USB_MBIM)
	ipa3_usb_ctx->qmi_req_id++;

	result = ipa3_usb_release_prod(ttype);
+6 −3
Original line number Diff line number Diff line
@@ -1404,7 +1404,10 @@ static int ipa3_xdci_stop_gsi_channel(u32 clnt_hdl, bool *stop_in_proc)
		return -EFAULT;
	}

	*stop_in_proc = res;
	if (res)
		*stop_in_proc = true;
	else
		*stop_in_proc = false;

	IPADBG("xDCI channel is %s (result=%d)\n",
		res ? "STOP_IN_PROC/TimeOut" : "STOP", res);
@@ -1509,7 +1512,7 @@ static int ipa3_stop_ul_chan_with_data_drain(u32 qmi_req_id,
	}
	/* if still stop_in_proc or not empty, activate force clear */
	if (should_force_clear) {
		result = ipa3_enable_force_clear(qmi_req_id, true,
		result = ipa3_enable_force_clear(qmi_req_id, false,
			source_pipe_bitmask);
		if (result)
			goto exit;
@@ -1536,7 +1539,7 @@ static int ipa3_stop_ul_chan_with_data_drain(u32 qmi_req_id,

disable_force_clear_and_exit:
	if (should_force_clear)
		result = ipa3_disable_force_clear(qmi_req_id);
		ipa3_disable_force_clear(qmi_req_id);
exit:
	return result;
}