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

Commit a61854fa authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss
Browse files

msm: mhi_dev: Update sequence when ipa_mhi_destroy is issued



Currently ipa_mhi_destroy() is issued during MHI device reset.
There could be a condition where the switch to M0 event is
in progress while the MHI device reset is received. Calling
ipa_mhi_destroy() followed by processing the M0 transition
causes IPA to assert since ipa_mhi_destroy() was already
issued. Therefore flush the workqueue that is processing
the switch to M0 transition before calling ipa_mhi_destroy().

Change-Id: I298fdc67cb5d660ba8b722016a0b4d9deb32142a
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent 729858b4
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -1686,9 +1686,6 @@ static int mhi_dev_abort(struct mhi_dev *mhi)
	flush_workqueue(mhi->ring_init_wq);
	flush_workqueue(mhi->pending_ring_wq);

	/* Initiate MHI IPA reset */
	ipa_mhi_destroy();

	/* Clean up initialized channels */
	rc = mhi_deinit(mhi);
	if (rc) {
+2 −0
Original line number Diff line number Diff line
@@ -968,6 +968,8 @@ int mhi_dev_sm_exit(struct mhi_dev *mhi_dev)
	mhi_sm_debugfs_destroy();
	flush_workqueue(mhi_sm_ctx->mhi_sm_wq);
	destroy_workqueue(mhi_sm_ctx->mhi_sm_wq);
	/* Initiate MHI IPA reset */
	ipa_mhi_destroy();
	ipa_dma_destroy();
	mutex_destroy(&mhi_sm_ctx->mhi_state_lock);
	devm_kfree(mhi_dev->dev, mhi_sm_ctx);