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

Commit d68a3490 authored by Manu Gautam's avatar Manu Gautam
Browse files

msm: pcie: Disable access to MSI register during drv_suspend



Access to MSI registers requires PCIe clocks to be ON. If any
pcie client driver tries to disable PCIe MSI provided by the
controller then that can result in unclocked access. Fix it
by restricting access during drv_suspend. For non drv_suspend
or pm_suspend it is already handled.

Change-Id: I4db72ce22773f0b6b52c9e704c9ec9a3a1de3d8c
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 5168327a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -6851,6 +6851,9 @@ static int msm_pcie_drv_resume(struct msm_pcie_dev_t *pcie_dev)
	spin_unlock_irq(&pcie_dev->cfg_lock);
	pcie_dev->link_status = MSM_PCIE_LINK_ENABLED;

	/* resume access to MSI register as link is resumed */
	msm_msi_config_access(dev_get_msi_domain(&pcie_dev->dev->dev), true);

	enable_irq(pcie_dev->irq[MSM_PCIE_INT_GLOBAL_INT].num);

	mutex_unlock(&pcie_dev->setup_lock);
@@ -6886,6 +6889,9 @@ static int msm_pcie_drv_suspend(struct msm_pcie_dev_t *pcie_dev,
		goto out;
	}

	/* suspend access to MSI register. resume access in drv_resume */
	msm_msi_config_access(dev_get_msi_domain(&pcie_dev->dev->dev), false);

	pcie_dev->user_suspend = true;
	set_bit(pcie_dev->rc_idx, &pcie_drv.rc_drv_enabled);
	spin_lock_irq(&pcie_dev->cfg_lock);