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

Commit 1a384920 authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss
Browse files

mhi_dev: mhi: Update MSI get sequence during initialization



Modem host interface (MHI) device may get probed on the
device side before host driver is actually up on the
host side. So its possible the MSIs may not be enabled
by the host at the time of the probe on the device side.
So the logic in the initialization sequence is modified
to factor this possibility of not having MSIs at the
time of the probe.

Change-Id: Iefb3a1acd76530a8e52321d375535858df16f955
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent 0b2ba357
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -36,7 +36,7 @@
/* Wait time on the device for Host to set M0 state */
#define MHI_M0_WAIT_MIN_USLEEP		20000000
#define MHI_M0_WAIT_MAX_USLEEP		25000000
#define MHI_DEV_M0_MAX_CNT		10
#define MHI_DEV_M0_MAX_CNT		30
/* Wait time before suspend/resume is complete */
#define MHI_SUSPEND_WAIT_MIN		3100
#define MHI_SUSPEND_WAIT_MAX		3200
@@ -1625,14 +1625,13 @@ static void mhi_dev_enable(struct work_struct *work)
	mhi_dev_sm_set_ready();

	rc = ep_pcie_get_msi_config(mhi->phandle, &msi_cfg);
	if (rc) {
		pr_err("MHI: error geting msi configs\n");
		return;
	}

	if (rc)
		pr_warn("MHI: error geting msi configs\n");
	else {
		rc = ep_pcie_trigger_msi(mhi->phandle, mhi->mhi_ep_msi_num);
		if (rc)
			return;
	}

	rc = mhi_dev_mmio_get_mhi_state(mhi, &state);
	if (rc) {