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

Commit 1d89fa40 authored by Siva Kumar Akkireddi's avatar Siva Kumar Akkireddi Committed by Nitesh Gupta
Browse files

msm: mhi_dev: Fix race in MHI control state update



MHI control state can be updated to CONNECTED via the IPA
callback before MHI sets it to CONFIGURED. Check if it
is already updated in the callback to CONNECTED before setting it
to CONFIGURED.

Change-Id: Ia8506d2d1a700a1e122137f9fffe4ba16fb852c2
Signed-off-by: default avatarSiva Kumar Akkireddi <sivaa@codeaurora.org>
parent 8ad637ef
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -2907,11 +2907,20 @@ static void mhi_dev_enable(struct work_struct *work)
		enable_irq(mhi_ctx->mhi_irq);
	}

	/*
	 * ctrl_info might already be set to CONNECTED state in the
	 * callback function mhi_hwc_cb triggered from IPA when mhi_hwc_init
	 * is called above, so set to CONFIGURED state only when it
	 * is not already set to CONNECTED
	 */
	if (mhi_ctx->ctrl_info != MHI_STATE_CONNECTED)
		mhi_update_state_info(MHI_STATE_CONFIGURED);

	/*Enable MHI dev network stack Interface*/
	rc = mhi_dev_net_interface_init();
	if (rc)
		pr_err("%s Failed to initialize mhi_dev_net iface\n", __func__);
	mhi_update_state_info(MHI_STATE_CONFIGURED);

}

static void mhi_ring_init_cb(void *data)