From c0896b1af74c49de31f54aace5dd924cdd9758b6 Mon Sep 17 00:00:00 2001 From: Nagarjuna Kristam Date: Tue, 9 Jul 2024 16:20:58 +0530 Subject: [PATCH] pci: epf: dma-test: Clear bar only for T23x During EP deinit, BAR is cleared. However, For T26x, this notification is triggered from stop() ops callback. Both stop and clear bar executes on EPC mutex lock, resulting in deadlock. Since during EP deinit all EP registers are cleared, clear_bar execution is not needed. Bug 4567932 Change-Id: I7b28a85a4da51bdaf5228b6462fb723758c46753 Signed-off-by: Nagarjuna Kristam Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3171420 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/pci/endpoint/functions/pci-epf-dma-test.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/pci/endpoint/functions/pci-epf-dma-test.c b/drivers/pci/endpoint/functions/pci-epf-dma-test.c index 44efac32..81f6cc41 100644 --- a/drivers/pci/endpoint/functions/pci-epf-dma-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-dma-test.c @@ -270,16 +270,13 @@ static int pcie_dma_epf_core_deinit(struct pci_epf *epf) if (epfnv->chip_id == TEGRA234) bar = BAR_0; - else - bar = BAR_1; + epf_bar = &epf->bar[bar]; epfnv->edma.cookie = NULL; epf_bar_virt->rp_phy_addr = 0; tegra_pcie_dma_deinit(&cookie); - lpci_epc_clear_bar(epc, epf->func_no, epf_bar); - if (epfnv->chip_id == TEGRA264) - lpci_epc_clear_bar(epc, epf->func_no, &epf->bar[BAR_2]); - + if (epfnv->chip_id == TEGRA234) + lpci_epc_clear_bar(epc, epf->func_no, epf_bar); return 0; } #endif