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

Commit d40a58d1 authored by Siva Kumar Akkireddi's avatar Siva Kumar Akkireddi Committed by Siddartha Mohanadoss
Browse files

msm: mhi_dev: Initialize MHI only once after linkup



Initialize MHI only once even if host sends multiple BMEs
which result in multiple callbacks to MHI from PCIE driver.

Change-Id: I13f0383d4eeee7aadd47176029283b01153872d3
Signed-off-by: default avatarSiva Kumar Akkireddi <sivaa@codeaurora.org>
parent e6141da7
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3214,6 +3214,15 @@ static int mhi_dev_resume_mmio_mhi_init(struct mhi_dev *mhi_ctx)
	struct platform_device *pdev;
	int rc = 0;

	/*
	 * There could be multiple calls to this function if device gets
	 * multiple link-up events (bme irqs).
	 */
	if (mhi_ctx->init_done) {
		mhi_log(MHI_MSG_INFO, "mhi init already done, returning\n");
		return 0;
	}

	pdev = mhi_ctx->pdev;

	INIT_WORK(&mhi_ctx->chdb_ctrl_work, mhi_dev_scheduler);
@@ -3345,6 +3354,8 @@ static int mhi_dev_resume_mmio_mhi_init(struct mhi_dev *mhi_ctx)
	if (mhi_ctx->use_edma)
		mhi_ring_init_cb(mhi_ctx);

	mhi_ctx->init_done = true;

	return 0;
}

+3 −0
Original line number Diff line number Diff line
@@ -567,6 +567,9 @@ struct mhi_dev {
	/* iATU is required to map control and data region */
	bool				config_iatu;

	/* Indicates if mhi init is done */
	bool				init_done;

	/* MHI state info */
	enum mhi_ctrl_info		ctrl_info;