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

Commit 2e70e6c1 authored by Divya Sharma's avatar Divya Sharma
Browse files

Revert "msm: ipa: Unlock mutex before voting PCIe clocks"



This reverts commit 048d4a98.

Change-Id: I4ae6e9d9b5d33546152d336f1d8e677818f7bac5
Signed-off-by: default avatarDivya Sharma <divyash@codeaurora.org>
parent fdd67ccc
Loading
Loading
Loading
Loading
+3 −13
Original line number Original line Diff line number Diff line
@@ -613,31 +613,21 @@ int imp_handle_vote_req(bool vote)
		mutex_unlock(&imp_ctx->mutex);
		mutex_unlock(&imp_ctx->mutex);
		return -EPERM;
		return -EPERM;
	}
	}
	mutex_unlock(&imp_ctx->mutex);


	/*
	 * Unlock the mutex before calling into mhi for clock vote
	 * to avoid deadlock on imp mutex.
	 * Calls into mhi are synchronous and imp callbacks are
	 * executed from mhi context.
	 */
	if (vote) {
	if (vote) {
		ret = mhi_device_get_sync(imp_ctx->md.mhi_dev);
		ret = mhi_device_get_sync(imp_ctx->md.mhi_dev);
		if (ret) {
		if (ret) {
			IMP_ERR("mhi_sync_get failed %d\n", ret);
			IMP_ERR("mhi_sync_get failed %d\n", ret);
			mutex_unlock(&imp_ctx->mutex);
			return ret;
			return ret;
		}
		}
		imp_ctx->lpm_disabled = true;
	} else {
	} else {
		mhi_device_put(imp_ctx->md.mhi_dev);
		mhi_device_put(imp_ctx->md.mhi_dev);
		imp_ctx->lpm_disabled = false;
	}
	}


	mutex_lock(&imp_ctx->mutex);
	if (vote)
		imp_ctx->lpm_disabled = true;
	else
		imp_ctx->lpm_disabled = false;
	mutex_unlock(&imp_ctx->mutex);
	mutex_unlock(&imp_ctx->mutex);

	return 0;
	return 0;
}
}