From e9b647b739248f936e78ebcf71bf7b491900fb8e Mon Sep 17 00:00:00 2001 From: Gauri Joshi Date: Wed, 11 Aug 2021 14:50:24 -0700 Subject: [PATCH] msm: ep-pcie: Enable global IRQ after enumeration The global irqs are being enabled before EP driver has completed successful link enumeration. This causes a race condition where the BME IRQ is processed before link up causing the link up to exit before updating the link status. Any further processing results in LINK_DISABLED error. Avoid this scenario by enabling the global interrupts after enumeration has finished. Change-Id: I983a35f461da5d8966cadc9918b5529d16182b47 Signed-off-by: Gauri Joshi --- drivers/platform/msm/ep_pcie/ep_pcie_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/platform/msm/ep_pcie/ep_pcie_core.c b/drivers/platform/msm/ep_pcie/ep_pcie_core.c index 04ab872a6912..507b696438e8 100644 --- a/drivers/platform/msm/ep_pcie/ep_pcie_core.c +++ b/drivers/platform/msm/ep_pcie/ep_pcie_core.c @@ -2596,6 +2596,7 @@ int32_t ep_pcie_irq_init(struct ep_pcie_dev_t *dev) INIT_WORK(&dev->handle_d3cold_work, handle_d3cold_func); if (dev->aggregated_irq) { + irq_set_status_flags(dev->irq[EP_PCIE_INT_GLOBAL].num, IRQ_NOAUTOEN); ret = devm_request_irq(pdev, dev->irq[EP_PCIE_INT_GLOBAL].num, ep_pcie_handle_global_irq, @@ -3440,6 +3441,7 @@ static int ep_pcie_probe(struct platform_device *pdev) qcom_edma_init(&pdev->dev); + enable_irq(ep_pcie_dev.irq[EP_PCIE_INT_GLOBAL].num); return 0; irq_deinit: