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

Commit 102733c2 authored by Yan He's avatar Yan He
Browse files

msm: pcie: add lock for user issued suspend



Add the mutex lock for suspend issued by PCIe client driver so that
it will not conflict with the wake IRQ handling.

Change-Id: I5d427e99d929a319e507368d386507c72ee3cdfc
CRs-fixed: 660086
Signed-off-by: default avatarYan He <yanhe@codeaurora.org>
parent e589fedd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1908,6 +1908,8 @@ int msm_pcie_pm_control(enum msm_pcie_pm_opt pm_opt, u32 busnr, void *user,
		}
		if (!(options & MSM_PCIE_CONFIG_LINKDOWN))
			msm_pcie_dev[rc_idx].user_suspend = true;

		mutex_lock(&msm_pcie_dev[rc_idx].recovery_lock);
		ret = msm_pcie_pm_suspend(dev, user, data, options);
		if (ret) {
			pr_err(
@@ -1915,6 +1917,7 @@ int msm_pcie_pm_control(enum msm_pcie_pm_opt pm_opt, u32 busnr, void *user,
				rc_idx);
			msm_pcie_dev[rc_idx].user_suspend = false;
		}
		mutex_unlock(&msm_pcie_dev[rc_idx].recovery_lock);
		break;
	case MSM_PCIE_RESUME:
		PCIE_DBG("User of RC%d requests to resume the link\n", rc_idx);