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

Commit 2fe5e492 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mhi: cntrl: qcom: schedule boot monitor thread conditionally"

parents d2ae82fc cbf8e525
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ static int mhi_arch_esoc_ops_power_on(void *priv, unsigned int flags)
		return ret;
	}

	mhi_dev->mdm_state = (flags & ESOC_HOOK_MDM_CRASH);
	return mhi_pci_probe(pci_dev, NULL);
}

@@ -312,7 +313,8 @@ static void mhi_boot_monitor(void *data, async_cookie_t cookie)

	/* wait for device to enter boot stage */
	wait_event_timeout(mhi_cntrl->state_event, mhi_cntrl->ee == MHI_EE_AMSS
			   || mhi_cntrl->ee == MHI_EE_DISABLE_TRANSITION,
			   || mhi_cntrl->ee == MHI_EE_DISABLE_TRANSITION
			   || mhi_cntrl->power_down,
			   timeout);

	ipc_log_string(arch_info->boot_ipc_log, HLOG "Device current ee = %s\n",
@@ -334,7 +336,8 @@ int mhi_arch_power_up(struct mhi_controller *mhi_cntrl)
	struct mhi_dev *mhi_dev = mhi_controller_get_devdata(mhi_cntrl);
	struct arch_info *arch_info = mhi_dev->arch_info;

	/* start a boot monitor */
	/* start a boot monitor if not in crashed state */
	if (!mhi_dev->mdm_state)
		arch_info->cookie = async_schedule(mhi_boot_monitor, mhi_cntrl);

	return 0;
+2 −1
Original line number Diff line number Diff line
@@ -559,8 +559,9 @@ static int mhi_qcom_power_up(struct mhi_controller *mhi_cntrl)
			return -EIO;
	}

	/* when coming out of SSR, initial ee state is not valid */
	/* when coming out of SSR, initial states are not valid */
	mhi_cntrl->ee = 0;
	mhi_cntrl->power_down = false;

	ret = mhi_arch_power_up(mhi_cntrl);
	if (ret)
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ struct mhi_dev {
	int resn;
	void *arch_info;
	bool powered_on;
	bool mdm_state;
	dma_addr_t iova_start;
	dma_addr_t iova_stop;
	enum mhi_suspend_mode suspend_mode;
+2 −0
Original line number Diff line number Diff line
@@ -565,6 +565,8 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl,
		mhi_cntrl->ee = MHI_EE_DISABLE_TRANSITION;
		mhi_cntrl->dev_state = MHI_STATE_RESET;
	}
	/* notify controller of power down regardless of state transitions */
	mhi_cntrl->power_down = true;
	write_unlock_irq(&mhi_cntrl->pm_lock);

	/* wake up any threads waiting for state transitions */
+1 −0
Original line number Diff line number Diff line
@@ -373,6 +373,7 @@ struct mhi_controller {
	enum MHI_DEBUG_LEVEL log_lvl;

	/* controller specific data */
	bool power_down;
	void *priv_data;
	void *log_buf;
	struct dentry *dentry;