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

Commit d7c3cd34 authored by Ashok Vuyyuru's avatar Ashok Vuyyuru
Browse files

msm: ipa3: Fix to race condition to protect channel configuration



Because of race condition observing the end point channel configuration
mismatch, it leads to device assert. Added changes to fix racecondition.

Change-Id: Iaa5ce915067c4f96fc4e947ec7994d0e63609cf8
Signed-off-by: default avatarAshok Vuyyuru <avuyyuru@codeaurora.org>
parent 4a3d1ca8
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -2539,6 +2539,19 @@ static int ipa3_q6_set_ex_path_to_apps(void)
	return retval;
}

/*
 * ipa3_update_ssr_state() - updating current SSR state
 * @is_ssr:	[in] Current SSR state
 */

void ipa3_update_ssr_state(bool is_ssr)
{
	if (is_ssr)
		atomic_set(&ipa3_ctx->is_ssr, 1);
	else
		atomic_set(&ipa3_ctx->is_ssr, 0);
}

/**
 * ipa3_q6_pre_shutdown_cleanup() - A cleanup for all Q6 related configuration
 *                    in IPA HW. This is performed in case of SSR.
@@ -2552,6 +2565,7 @@ void ipa3_q6_pre_shutdown_cleanup(void)

	IPA_ACTIVE_CLIENTS_INC_SIMPLE();

	ipa3_update_ssr_state(true);
	if (!ipa3_ctx->ipa_endp_delay_wa)
		ipa3_q6_pipe_delay(true);
	ipa3_q6_avoid_holb();
+2 −0
Original line number Diff line number Diff line
@@ -1709,6 +1709,7 @@ struct ipa3_context {
	int (*client_lock_unlock[IPA_MAX_CLNT])(bool is_lock);
	bool fw_loaded;
	bool (*get_teth_port_state[IPA_MAX_CLNT])(void);
	atomic_t is_ssr;
};

struct ipa3_plat_drv_res {
@@ -2579,6 +2580,7 @@ int ipa3_tag_process(struct ipa3_desc *desc, int num_descs,
void ipa3_q6_pre_shutdown_cleanup(void);
void ipa3_q6_post_shutdown_cleanup(void);
void ipa3_q6_pre_powerup_cleanup(void);
void ipa3_update_ssr_state(bool is_ssr);
int ipa3_init_q6_smem(void);

int ipa3_mhi_handle_ipa_config_req(struct ipa_config_req_msg_v01 *config_req);
+5 −1
Original line number Diff line number Diff line
@@ -7480,7 +7480,11 @@ void ipa3_suspend_apps_pipes(bool suspend)
					IPAERR("failed to stop WAN channel\n");
					ipa_assert();
				}
			} else {
			} else if (!atomic_read(&ipa3_ctx->is_ssr)) {
				/* If SSR was alreday started not required to
				 * start WAN channel,Because in SSR will stop
				 * channel and reset the channel.
				 */
				res = gsi_start_channel(ep->gsi_chan_hdl);
				if (res) {
					IPAERR("failed to start WAN channel\n");
+1 −0
Original line number Diff line number Diff line
@@ -2735,6 +2735,7 @@ static int ipa3_wwan_probe(struct platform_device *pdev)
	}
	atomic_set(&rmnet_ipa3_ctx->is_ssr, 0);
	atomic_set(&rmnet_ipa3_ctx->ap_suspend, 0);
	ipa3_update_ssr_state(false);

	IPAWANERR("rmnet_ipa completed initialization\n");
	return 0;