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

Commit a17a6bf7 authored by Mohammed Javid's avatar Mohammed Javid
Browse files

msm: ipa3: Remove ep_delay on disconnect sequence



When device in Low Power Mode, usb driver invokes
suspend and then disconnect upon cable disconnection.
Remove the ep delay if it is set.

Change-Id: I203d57d70e8c189a2f3bc7f7830392fac98cfbb1
Signed-off-by: default avatarMohammed Javid <mjavid@codeaurora.org>
parent a8118139
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -2225,6 +2225,7 @@ static int ipa_usb_xdci_dismiss_channels(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
	}
	}


	if (!IPA3_USB_IS_TTYPE_DPL(ttype)) {
	if (!IPA3_USB_IS_TTYPE_DPL(ttype)) {
		ipa3_xdci_ep_delay_rm(ul_clnt_hdl); /* Remove ep_delay if set */
		/* Reset UL channel */
		/* Reset UL channel */
		result = ipa3_reset_gsi_channel(ul_clnt_hdl);
		result = ipa3_reset_gsi_channel(ul_clnt_hdl);
		if (result) {
		if (result) {
+42 −0
Original line number Original line Diff line number Diff line
@@ -1163,6 +1163,48 @@ static int ipa3_stop_ul_chan_with_data_drain(u32 qmi_req_id,
	return result;
	return result;
}
}


void ipa3_xdci_ep_delay_rm(u32 clnt_hdl)
{
	struct ipa3_ep_context *ep;
	struct ipa_ep_cfg_ctrl ep_cfg_ctrl;
	int result;

	if (clnt_hdl >= ipa3_ctx->ipa_num_pipes ||
		ipa3_ctx->ep[clnt_hdl].valid == 0) {
		IPAERR("bad parm.\n");
		return;
	}

	ep = &ipa3_ctx->ep[clnt_hdl];

	if (ep->ep_delay_set == true) {

		memset(&ep_cfg_ctrl, 0, sizeof(struct ipa_ep_cfg_ctrl));
		ep_cfg_ctrl.ipa_ep_delay = false;

		if (!ep->keep_ipa_awake)
			IPA_ACTIVE_CLIENTS_INC_EP
				(ipa3_get_client_mapping(clnt_hdl));

		result = ipa3_cfg_ep_ctrl(clnt_hdl,
			&ep_cfg_ctrl);

		if (!ep->keep_ipa_awake)
			IPA_ACTIVE_CLIENTS_DEC_EP
				(ipa3_get_client_mapping(clnt_hdl));

		if (result) {
			IPAERR
			("client (ep: %d) failed to remove delay result=%d\n",
				clnt_hdl, result);
		} else {
			IPADBG("client (ep: %d) delay removed\n",
				clnt_hdl);
			ep->ep_delay_set = false;
		}
	}
}

int ipa3_xdci_disconnect(u32 clnt_hdl, bool should_force_clear, u32 qmi_req_id)
int ipa3_xdci_disconnect(u32 clnt_hdl, bool should_force_clear, u32 qmi_req_id)
{
{
	struct ipa3_ep_context *ep;
	struct ipa3_ep_context *ep;
+2 −0
Original line number Original line Diff line number Diff line
@@ -1682,6 +1682,8 @@ int ipa3_xdci_connect(u32 clnt_hdl);


int ipa3_xdci_disconnect(u32 clnt_hdl, bool should_force_clear, u32 qmi_req_id);
int ipa3_xdci_disconnect(u32 clnt_hdl, bool should_force_clear, u32 qmi_req_id);


void ipa3_xdci_ep_delay_rm(u32 clnt_hdl);

int ipa3_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
int ipa3_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
	bool should_force_clear, u32 qmi_req_id, bool is_dpl);
	bool should_force_clear, u32 qmi_req_id, bool is_dpl);