ep_pcie: core: Initialize the edma only after successful enumeration

If enumeration fails all the resources will be turned off and then
if try to access at that point system is crashing.

Change-Id: I3b0a5c02df84671dc96bcb6e99de2ff4ea1ee069
Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
This commit is contained in:
Krishna chaitanya chundru 2022-03-04 15:31:11 +05:30
parent d65ddb2c3d
commit 823e37ac3c

View File

@ -1391,6 +1391,11 @@ static void ep_pcie_enumeration_complete(struct ep_pcie_dev_t *dev)
dev->rev);
goto done;
}
spin_unlock_irqrestore(&dev->isr_lock, irqsave_flags);
qcom_edma_init(&dev->pdev->dev);
spin_lock_irqsave(&dev->isr_lock, irqsave_flags);
dev->enumerated = true;
dev->link_status = EP_PCIE_LINK_ENABLED;
@ -3477,7 +3482,6 @@ static int ep_pcie_probe(struct platform_device *pdev)
EP_PCIE_ERR(&ep_pcie_dev,
"PCIe V%d: failed to init GPIO\n",
ep_pcie_dev.rev);
ep_pcie_release_resources(&ep_pcie_dev);
goto gpio_failure;
}
@ -3486,8 +3490,6 @@ static int ep_pcie_probe(struct platform_device *pdev)
EP_PCIE_ERR(&ep_pcie_dev,
"PCIe V%d: failed to init IRQ\n",
ep_pcie_dev.rev);
ep_pcie_release_resources(&ep_pcie_dev);
ep_pcie_gpio_deinit(&ep_pcie_dev);
goto irq_failure;
}
@ -3521,7 +3523,6 @@ static int ep_pcie_probe(struct platform_device *pdev)
atomic_notifier_chain_register(&panic_notifier_list,
&ep_pcie_core_panic_notifier);
qcom_edma_init(&pdev->dev);
if (!ep_pcie_dev.perst_enum)
enable_irq(ep_pcie_dev.irq[EP_PCIE_INT_GLOBAL].num);