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: Siddartha Mohanadoss <smohanad@codeaurora.org>
tirimbino
Siddartha Mohanadoss 5 years ago
parent 729858b485
commit a61854fa77
  1. 3
      drivers/platform/msm/mhi_dev/mhi.c
  2. 2
      drivers/platform/msm/mhi_dev/mhi_sm.c

@ -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) {

@ -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);

Loading…
Cancel
Save