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

Commit 27499298 authored by Sujeev Dias's avatar Sujeev Dias Committed by Conner Huff
Browse files

mhi: core: do not acquire channel mutex to notify clients



A deadlock is seen when an MHI client attempts to start channels
for transfer and MHI core driver tries to notify the client of a
a status change. Remove mutex from notify path as it should not
be required since we already use the safe list iteration option.

CRs-Fixed: 2521963
Change-Id: I6388547fb3e0daa1763974a1a8579a3831e3679a
Acked-by: default avatarBhaumik Vasav Bhatt <bbhatt@qti.qualcomm.com>
Signed-off-by: default avatarSujeev Dias <sdias@codeaurora.org>
parent 71d33d32
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -1107,10 +1107,8 @@ int mhi_pm_suspend(struct mhi_controller *mhi_cntrl)

	/* notify any clients we enter lpm */
	list_for_each_entry_safe(itr, tmp, &mhi_cntrl->lpm_chans, node) {
		mutex_lock(&itr->mutex);
		if (itr->mhi_dev)
			mhi_notify(itr->mhi_dev, MHI_CB_LPM_ENTER);
		mutex_unlock(&itr->mutex);
	}

	return 0;
@@ -1213,10 +1211,8 @@ int mhi_pm_fast_suspend(struct mhi_controller *mhi_cntrl, bool notify_client)

	/* notify any clients we enter lpm */
	list_for_each_entry_safe(itr, tmp, &mhi_cntrl->lpm_chans, node) {
		mutex_lock(&itr->mutex);
		if (itr->mhi_dev)
			mhi_notify(itr->mhi_dev, MHI_CB_LPM_ENTER);
		mutex_unlock(&itr->mutex);
	}

	return 0;
@@ -1252,10 +1248,8 @@ int mhi_pm_resume(struct mhi_controller *mhi_cntrl)

	/* notify any clients we enter lpm */
	list_for_each_entry_safe(itr, tmp, &mhi_cntrl->lpm_chans, node) {
		mutex_lock(&itr->mutex);
		if (itr->mhi_dev)
			mhi_notify(itr->mhi_dev, MHI_CB_LPM_EXIT);
		mutex_unlock(&itr->mutex);
	}

	write_lock_irq(&mhi_cntrl->pm_lock);
@@ -1328,10 +1322,8 @@ int mhi_pm_fast_resume(struct mhi_controller *mhi_cntrl, bool notify_client)
	if (notify_client) {
		list_for_each_entry_safe(itr, tmp, &mhi_cntrl->lpm_chans,
					 node) {
			mutex_lock(&itr->mutex);
			if (itr->mhi_dev)
				mhi_notify(itr->mhi_dev, MHI_CB_LPM_EXIT);
			mutex_unlock(&itr->mutex);
		}
	}