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

Commit f8532422 authored by Akshay Pandit's avatar Akshay Pandit
Browse files

msm: ipa3: Decrement clock count in case of error handling properly



Decrease the clock count in case error occurs when using wdi pipe
disconnect, enable & disable APIs. Clear pipe context after logging
clock devote in debugfs during wdi disconnect.
Also, decrement clock count in case of error during configuring QMB
and max packet size for USB use case.

Change-Id: I3785d5ee4961a1f8a34168e0885589350c021b41
Signed-off-by: default avatarAkshay Pandit <pandit@codeaurora.org>
parent 19ffb351
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -756,12 +756,13 @@ int ipa3_request_gsi_channel(struct ipa_request_gsi_channel_params *params,
		if (ipa_ep_idx >= ipa3_ctx->ipa_num_pipes ||
			ipa3_ctx->ep[ipa_ep_idx].valid == 0) {
			IPAERR("bad parm.\n");
			return -EINVAL;
			result = -EINVAL;
			goto ipa_cfg_ep_fail;
		}
		result = ipa3_cfg_ep_cfg(ipa_ep_idx, &params->ipa_ep_cfg.cfg);
		if (result) {
			IPAERR("fail to configure QMB.\n");
			return result;
			goto ipa_cfg_ep_fail;
		}
	}

@@ -903,6 +904,7 @@ int ipa3_set_usb_max_packet_size(
		&dev_scratch);
	if (gsi_res != GSI_STATUS_SUCCESS) {
		IPAERR("Error writing device scratch: %d\n", gsi_res);
		IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
		return -EFAULT;
	}
	IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
+11 −7
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 2020 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1290,15 +1290,18 @@ int ipa3_disconnect_wdi_pipe(u32 clnt_hdl)

	if (result) {
		result = -EFAULT;
		if (!ep->keep_ipa_awake)
			IPA_ACTIVE_CLIENTS_DEC_EP(
				ipa3_get_client_mapping(clnt_hdl));
		goto uc_timeout;
	}

	ipa3_delete_dflt_flt_rules(clnt_hdl);
	ipa_release_uc_smmu_mappings(ep->client);

	memset(&ipa3_ctx->ep[clnt_hdl], 0, sizeof(struct ipa3_ep_context));
	if (!ep->keep_ipa_awake)
		IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl));

	memset(&ipa3_ctx->ep[clnt_hdl], 0, sizeof(struct ipa3_ep_context));
	IPADBG("client (ep: %d) disconnected\n", clnt_hdl);

	/* for AP+STA stats update */
@@ -1364,7 +1367,8 @@ int ipa3_enable_wdi_pipe(u32 clnt_hdl)
	if (rsrc_grp.rsrc_grp == -1) {
		IPAERR("invalid group for client %d\n", ep->client);
		WARN_ON(1);
		return -EFAULT;
		result = -EFAULT;
		goto uc_timeout;
	}

	IPADBG("Setting group %d for pipe %d\n",
@@ -1378,11 +1382,11 @@ int ipa3_enable_wdi_pipe(u32 clnt_hdl)
		holb_cfg.tmr_val = 0;
		result = ipa3_cfg_ep_holb(clnt_hdl, &holb_cfg);
	}
	IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl));
	ep->uc_offload_state |= IPA_WDI_ENABLED;
	IPADBG("client (ep: %d) enabled\n", clnt_hdl);

uc_timeout:
	IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl));
	return result;
}

@@ -1475,12 +1479,12 @@ int ipa3_disable_wdi_pipe(u32 clnt_hdl)
		ep_cfg_ctrl.ipa_ep_delay = true;
		ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl);
	}
	IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl));
	ep->uc_offload_state &= ~IPA_WDI_ENABLED;
	IPADBG("client (ep: %d) disabled\n", clnt_hdl);


uc_timeout:
	IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl));
	return result;
}

@@ -1748,11 +1752,11 @@ int ipa3_write_qmapid_wdi_pipe(u32 clnt_hdl, u8 qmap_id)
		result = -EFAULT;
		goto uc_timeout;
	}
	IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl));

	IPADBG("client (ep: %d) qmap_id %d updated\n", clnt_hdl, qmap_id);

uc_timeout:
	IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl));
	return result;
}