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

Commit c74c4c1e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa3: Enable HOLB on MHIP RMNET before stopping USB"

parents dce33dad 034ef7f4
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -1629,6 +1629,8 @@ int ipa3_start_gsi_channel(u32 clnt_hdl)
	int result = -EFAULT;
	enum gsi_status gsi_res;
	enum ipa_client_type client_type;
	struct ipa_ep_cfg_holb holb_cfg;
	int res = 0;

	IPADBG("entry\n");
	if (clnt_hdl >= ipa3_ctx->ipa_num_pipes  ||
@@ -1639,6 +1641,23 @@ int ipa3_start_gsi_channel(u32 clnt_hdl)

	ep = &ipa3_ctx->ep[clnt_hdl];
	client_type = ipa3_get_client_mapping(clnt_hdl);
	/* Disable HOLB on MHIP RMNET CONS before starting
	 * USB PROD pipe
	 */
	if (ipa3_is_mhip_offload_enabled() &&
		client_type == IPA_CLIENT_USB_PROD) {
		memset(&holb_cfg, 0, sizeof(struct ipa_ep_cfg_holb));
		holb_cfg.en = IPA_HOLB_TMR_DIS;
		holb_cfg.tmr_val = 0;
		IPADBG("Disabling HOLB on RMNET CONS pipe");
		res = ipa3_cfg_ep_holb(ipa3_get_ep_mapping(
				IPA_CLIENT_MHI_PRIME_RMNET_CONS), &holb_cfg);
		if (res) {
			IPAERR("Disable HOLB failed ep:%lu\n",
				ipa3_get_ep_mapping(
					IPA_CLIENT_MHI_PRIME_RMNET_CONS));
		}
	}
	if (!ep->keep_ipa_awake)
		IPA_ACTIVE_CLIENTS_INC_EP(client_type);

+19 −0
Original line number Diff line number Diff line
@@ -7608,6 +7608,7 @@ static int __ipa3_stop_gsi_channel(u32 clnt_hdl)
	struct ipa3_ep_context *ep;
	enum ipa_client_type client_type;
	struct IpaHwOffloadStatsAllocCmdData_t *gsi_info;
	struct ipa_ep_cfg_holb holb_cfg;

	if (clnt_hdl >= ipa3_ctx->ipa_num_pipes ||
		ipa3_ctx->ep[clnt_hdl].valid == 0) {
@@ -7665,6 +7666,24 @@ static int __ipa3_stop_gsi_channel(u32 clnt_hdl)
		}
	}

	/* Enable HOLB on MHIP RMNET CONS before stopping
	 * USB PROD pipe
	 */
	if (ipa3_is_mhip_offload_enabled() &&
		client_type == IPA_CLIENT_USB_PROD) {
		memset(&holb_cfg, 0, sizeof(struct ipa_ep_cfg_holb));
		holb_cfg.en = IPA_HOLB_TMR_EN;
		holb_cfg.tmr_val = 0;
		IPADBG("Enabling HOLB on RMNET CONS pipe");
		res = ipa3_cfg_ep_holb(ipa3_get_ep_mapping(
				IPA_CLIENT_MHI_PRIME_RMNET_CONS), &holb_cfg);
		if (res) {
			IPAERR("Enable HOLB failed ep:%lu\n",
				ipa3_get_ep_mapping(
					IPA_CLIENT_MHI_PRIME_RMNET_CONS));
		}
	}

	/*
	 * Apply the GSI stop retry logic if GSI returns err code to retry.
	 * Apply the retry logic for ipa_client_prod as well as ipa_client_cons.