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

Commit 0e4c14b5 authored by Siva Kumar Akkireddi's avatar Siva Kumar Akkireddi
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 b585bd9e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -3187,6 +3187,13 @@ 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*/