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

Commit daedab72 authored by Siva Kumar Akkireddi's avatar Siva Kumar Akkireddi Committed by Gerrit - the friendly Code Review server
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 c18d8cdb
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2900,6 +2900,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);
@@ -3027,6 +3036,8 @@ static int mhi_dev_resume_mmio_mhi_init(struct mhi_dev *mhi_ctx)
		disable_irq(mhi_ctx->mhi_irq);
	}

	mhi_ctx->init_done = true;

	return 0;
}

+3 −0
Original line number Diff line number Diff line
@@ -564,6 +564,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;