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

Commit d579d924 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa3: wait for uC load before USB disconnect" into msm-4.8

parents 0124362c 0c17c7d1
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3585,6 +3585,12 @@ static int ipa3_gsi_pre_fw_load_init(void)
	return 0;
}

static void ipa3_uc_is_loaded(void)
{
	IPADBG("\n");
	complete_all(&ipa3_ctx->uc_loaded_completion_obj);
}

static enum gsi_ver ipa3_get_gsi_ver(enum ipa_hw_type ipa_hw_type)
{
	enum gsi_ver gsi_ver;
@@ -3637,6 +3643,7 @@ static int ipa3_post_init(const struct ipa3_plat_drv_res *resource_p,
	int result;
	struct sps_bam_props bam_props = { 0 };
	struct gsi_per_props gsi_props;
	struct ipa3_uc_hdlrs uc_hdlrs = { 0 };

	if (ipa3_ctx->transport_prototype == IPA_TRANSPORT_TYPE_GSI) {
		memset(&gsi_props, 0, sizeof(gsi_props));
@@ -3713,6 +3720,9 @@ static int ipa3_post_init(const struct ipa3_plat_drv_res *resource_p,
	else
		IPADBG(":ipa Uc interface init ok\n");

	uc_hdlrs.ipa_uc_loaded_hdlr = ipa3_uc_is_loaded;
	ipa3_uc_register_handlers(IPA_HW_FEATURE_COMMON, &uc_hdlrs);

	result = ipa3_wdi_init();
	if (result)
		IPAERR(":wdi init failed (%d)\n", -result);
@@ -4336,6 +4346,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
	INIT_LIST_HEAD(&ipa3_ctx->ipa_ready_cb_list);

	init_completion(&ipa3_ctx->init_completion_obj);
	init_completion(&ipa3_ctx->uc_loaded_completion_obj);

	/*
	 * For GSI, we can't register the GSI driver yet, as it expects
+12 −0
Original line number Diff line number Diff line
@@ -99,6 +99,18 @@ int ipa3_disable_data_path(u32 clnt_hdl)

	/* Suspend the pipe */
	if (IPA_CLIENT_IS_CONS(ep->client)) {
		/*
		 * for RG10 workaround uC needs to be loaded before pipe can
		 * be suspended in this case.
		 */
		if (ipa3_ctx->apply_rg10_wa && ipa3_uc_state_check()) {
			IPADBG("uC is not loaded yet, waiting...\n");
			res = wait_for_completion_timeout(
				&ipa3_ctx->uc_loaded_completion_obj, 60 * HZ);
			if (res == 0)
				IPADBG("timeout waiting for uC to load\n");
		}

		memset(&ep_cfg_ctrl, 0, sizeof(struct ipa_ep_cfg_ctrl));
		ep_cfg_ctrl.ipa_ep_suspend = true;
		ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl);
+1 −0
Original line number Diff line number Diff line
@@ -1230,6 +1230,7 @@ struct ipa3_context {
	bool ipa_initialization_complete;
	struct list_head ipa_ready_cb_list;
	struct completion init_completion_obj;
	struct completion uc_loaded_completion_obj;
	struct ipa3_smp2p_info smp2p_info;
};