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

Commit 003806be authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 19dcd81d 94986e22
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3899,6 +3899,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);
}

/**
 * ipa3_post_init() - Initialize the IPA Driver (Part II).
 * This part contains all initialization which requires interaction with
@@ -3925,6 +3931,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));
@@ -4000,6 +4007,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);
@@ -4716,6 +4726,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;
		res = ipa3_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl);
+1 −0
Original line number Diff line number Diff line
@@ -1288,6 +1288,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;
	u32 ipa_tz_unlock_reg_num;
	struct ipa_tz_unlock_reg_info *ipa_tz_unlock_reg;