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

Commit 49cbe5fe authored by Sivan Reinstein's avatar Sivan Reinstein
Browse files

msm: ipa: fix race condition in ipa qmi service bringup



Due to a race condition between qmi server & qmi client in ipa
bringup after SSR, there's a need to make sure the curr_conn
pointer doesn't point to the old server connection during client
initialization in cases where the server disconnect callback
wasn't called before the client initialization.

CRs-fixed: 698486
Change-Id: I4f54c07c5c7ea2380f97ec7bff1eb98632777ec7
Signed-off-by: default avatarSivan Reinstein <sivanr@codeaurora.org>
parent 1f8da54f
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -510,13 +510,6 @@ static void ipa_q6_clnt_svc_arrive(struct work_struct *work)
	int rc;
	struct ipa_master_driver_init_complt_ind_msg_v01 ind;

	/*
	 * Setting the current connection to NULL, as due to a race between
	 * server and client clean-up in SSR, the disconnect_cb might not
	 * have necessarily been called
	 */
	curr_conn = NULL;

	/* Create a Local client port for QMI communication */
	ipa_q6_clnt = qmi_handle_create(ipa_q6_clnt_notify, NULL);
	if (!ipa_q6_clnt) {
@@ -618,6 +611,13 @@ static void ipa_qmi_service_init_worker(struct work_struct *work)
		return;
	}

	/*
	 * Setting the current connection to NULL, as due to a race between
	 * server and client clean-up in SSR, the disconnect_cb might not
	 * have necessarily been called
	 */
	curr_conn = NULL;

	rc = qmi_svc_register(ipa_svc_handle, &ipa_a5_svc_ops_options);
	if (rc < 0) {
		IPAWANERR("Registering ipa_a5 svc failed %d\n",