From d68a3490c1ee1e6909daea244b02597411b58af4 Mon Sep 17 00:00:00 2001 From: Manu Gautam Date: Tue, 29 Sep 2020 17:12:39 +0530 Subject: [PATCH] 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: Manu Gautam --- drivers/pci/controller/pci-msm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pci/controller/pci-msm.c b/drivers/pci/controller/pci-msm.c index cfedf58d72a8..674ade11c1f8 100644 --- a/drivers/pci/controller/pci-msm.c +++ b/drivers/pci/controller/pci-msm.c @@ -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);