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

Commit c17f1783 authored by Gauri Joshi's avatar Gauri Joshi
Browse files

msm: mhi_dev: Add an option to not timeout waiting for M0



On certain platforms host might take a long time to send M0
to device. Only modified msm files in this commit.

Change-Id: I8c5f07a7926e01afa84a983ef98721749787d2da
Signed-off-by: default avatarSiva Kumar Akkireddi <sivaa@codeaurora.org>
Signed-off-by: default avatarGauri Joshi <gaurjosh@codeaurora.org>
parent 84a55b41
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3355,7 +3355,8 @@ static void mhi_dev_enable(struct work_struct *work)
			"Cleared reset before waiting for M0\n");
	}

	while (state != MHI_DEV_M0_STATE && max_cnt < MHI_SUSPEND_TIMEOUT) {
	while (state != MHI_DEV_M0_STATE &&
		((max_cnt < MHI_SUSPEND_TIMEOUT) || mhi->no_m0_timeout)) {
		/* Wait for Host to set the M0 state */
		msleep(MHI_SUSPEND_MIN);
		rc = mhi_dev_mmio_get_mhi_state(mhi, &state, &mhi_reset);
@@ -3624,6 +3625,9 @@ static int get_device_tree_data(struct platform_device *pdev)
	mhi->enable_m2 = of_property_read_bool((&pdev->dev)->of_node,
				"qcom,enable-m2");

	mhi->no_m0_timeout = of_property_read_bool((&pdev->dev)->of_node,
		"qcom,no-m0-timeout");

	mhi_log(MHI_MSG_VERBOSE, "acquiring wakelock\n");

	return 0;
+4 −0
Original line number Diff line number Diff line
@@ -595,9 +595,13 @@ struct mhi_dev {
	/*Register for interrupt*/
	bool				mhi_int;
	bool				mhi_int_en;

	/* Enable M2 autonomous mode from MHI */
	bool				enable_m2;

	/* Dont timeout waiting for M0 */
	bool				no_m0_timeout;

	/* Registered client callback list */
	struct list_head		client_cb_list;
	/* Tx, Rx DMA channels */