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

Commit 9b404b7f authored by Skylar Chang's avatar Skylar Chang
Browse files

msm: ipa3: implement GSI stop channel sequence



Add a new API to stop a GSI channel in IPA.
Due to a HW limitation, a special handling is needed in case
first attempt of stopping a GSI channel results in STOP_IN_PROG state.

Change-Id: Ieeaf7081de0faf7cbeb20dec919ef336fa931fce
Acked-by: default avatarAdy Abraham <adya@qti.qualcomm.com>
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
parent 6f9366f2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -2522,6 +2522,21 @@ struct ipa_gsi_ep_config *ipa_get_gsi_ep_info(int ipa_ep_idx)
}
EXPORT_SYMBOL(ipa_get_gsi_ep_info);

/**
 * ipa_stop_gsi_channel()- Stops a GSI channel in IPA
 *
 * Return value: 0 on success, negative otherwise
 */
int ipa_stop_gsi_channel(u32 clnt_hdl)
{
	int ret;

	IPA_API_DISPATCH_RETURN(ipa_stop_gsi_channel, clnt_hdl);

	return ret;
}
EXPORT_SYMBOL(ipa_stop_gsi_channel);

static struct of_device_id ipa_plat_drv_match[] = {
	{ .compatible = "qcom,ipa", },
	{ .compatible = "qcom,ipa-smmu-ap-cb", },
+2 −0
Original line number Diff line number Diff line
@@ -299,6 +299,8 @@ struct ipa_api_controller {

	int (*ipa_ap_resume)(struct device *dev);

	int (*ipa_stop_gsi_channel)(u32 clnt_hdl);

	struct iommu_domain *(*ipa_get_smmu_domain)(void);

	int (*ipa_disable_apps_wan_cons_deaggr)(uint32_t agg_size,
+8 −0
Original line number Diff line number Diff line
@@ -4867,6 +4867,13 @@ static struct ipa_gsi_ep_config *ipa2_get_gsi_ep_info(int ipa_ep_idx)
	return NULL;
}

static int ipa2_stop_gsi_channel(u32 clnt_hdl)
{
	IPAERR("Not supported for IPA 2.x\n");
	return -EFAULT;
}


int ipa2_bind_api_controller(enum ipa_hw_type ipa_hw_type,
	struct ipa_api_controller *api_ctrl)
{
@@ -5009,6 +5016,7 @@ int ipa2_bind_api_controller(enum ipa_hw_type ipa_hw_type,
	api_ctrl->ipa_rm_add_dependency_sync = ipa2_rm_add_dependency_sync;
	api_ctrl->ipa_get_dma_dev = ipa2_get_dma_dev;
	api_ctrl->ipa_get_gsi_ep_info = ipa2_get_gsi_ep_info;
	api_ctrl->ipa_stop_gsi_channel = ipa2_stop_gsi_channel;

	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -1308,7 +1308,6 @@ int ipa3_teardown_sys_pipe(u32 clnt_hdl)
		ipa3_inc_client_enable_clks();

	ipa3_disable_data_path(clnt_hdl);
	ep->valid = 0;

	if (IPA_CLIENT_IS_PROD(ep->client)) {
		do {
@@ -1324,7 +1323,7 @@ int ipa3_teardown_sys_pipe(u32 clnt_hdl)

	flush_workqueue(ep->sys->wq);
	if (ipa3_ctx->transport_prototype == IPA_TRANSPORT_TYPE_GSI) {
		result = ipa3_stop_gsi_channel(ep->gsi_chan_hdl);
		result = ipa3_stop_gsi_channel(clnt_hdl);
		if (result != GSI_STATUS_SUCCESS) {
			IPAERR("GSI stop chan err: %d.\n", result);
			BUG();
@@ -1394,6 +1393,7 @@ int ipa3_teardown_sys_pipe(u32 clnt_hdl)
	if (!atomic_read(&ipa3_ctx->wc_memb.active_clnt_cnt))
		ipa3_cleanup_wlan_rx_common_cache();

	ep->valid = 0;
	ipa3_dec_client_disable_clks();

	IPADBG("client (ep: %d) disconnected\n", clnt_hdl);
+2 −1
Original line number Diff line number Diff line
@@ -1519,6 +1519,8 @@ int ipa3_connect(const struct ipa_connect_params *in,
		u32 *clnt_hdl);
int ipa3_disconnect(u32 clnt_hdl);

int ipa3_stop_gsi_channel(u32 clnt_hdl);

/*
 * Resume / Suspend
 */
@@ -2051,6 +2053,5 @@ int ipa3_set_rt_tuple_mask(int tbl_idx, struct ipa3_hash_tuple *tuple);
void ipa3_set_resorce_groups_min_max_limits(void);
void ipa3_suspend_apps_pipes(bool suspend);

int ipa3_stop_gsi_channel(unsigned long chan_hdl);

#endif /* _IPA3_I_H_ */
Loading