]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: tegra194: Enable DMA interrupt
authorVidya Sagar <vidyas@nvidia.com>
Tue, 24 Mar 2026 19:09:55 +0000 (00:39 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 8 Apr 2026 22:00:24 +0000 (17:00 -0500)
Enable DMA interrupt to support Tegra PCIe DMA in both Root Port and
Endpoint modes.

Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/20260324191000.1095768-5-mmaddireddy@nvidia.com
drivers/pci/controller/dwc/pcie-tegra194.c

index 91b3953f780aa5bc73c5354ecb82d34b885bb3b2..409f8eaceb39582444470913a21314db800d3fd8 100644 (file)
@@ -91,6 +91,7 @@
 #define APPL_INTR_EN_L1_8_0                    0x44
 #define APPL_INTR_EN_L1_8_BW_MGT_INT_EN                BIT(2)
 #define APPL_INTR_EN_L1_8_AUTO_BW_INT_EN       BIT(3)
+#define APPL_INTR_EN_L1_8_EDMA_INT_EN          BIT(6)
 #define APPL_INTR_EN_L1_8_INTX_EN              BIT(11)
 #define APPL_INTR_EN_L1_8_AER_INT_EN           BIT(15)
 
@@ -544,6 +545,17 @@ static irqreturn_t tegra_pcie_ep_hard_irq(int irq, void *arg)
                spurious = 0;
        }
 
+       if (status_l0 & APPL_INTR_STATUS_L0_INT_INT) {
+               status_l1 = appl_readl(pcie, APPL_INTR_STATUS_L1_8_0);
+
+               /*
+                * Interrupt is handled by DMA driver; don't treat it as
+                * spurious
+                */
+               if (status_l1 & APPL_INTR_STATUS_L1_8_0_EDMA_INT_MASK)
+                       spurious = 0;
+       }
+
        if (spurious) {
                dev_warn(pcie->dev, "Random interrupt (STATUS = 0x%08X)\n",
                         status_l0);
@@ -780,6 +792,7 @@ static void tegra_pcie_enable_intx_interrupts(struct dw_pcie_rp *pp)
        val |= APPL_INTR_EN_L1_8_INTX_EN;
        val |= APPL_INTR_EN_L1_8_AUTO_BW_INT_EN;
        val |= APPL_INTR_EN_L1_8_BW_MGT_INT_EN;
+       val |= APPL_INTR_EN_L1_8_EDMA_INT_EN;
        if (IS_ENABLED(CONFIG_PCIEAER))
                val |= APPL_INTR_EN_L1_8_AER_INT_EN;
        appl_writel(pcie, val, APPL_INTR_EN_L1_8_0);
@@ -1806,6 +1819,7 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
        val |= APPL_INTR_EN_L0_0_SYS_INTR_EN;
        val |= APPL_INTR_EN_L0_0_LINK_STATE_INT_EN;
        val |= APPL_INTR_EN_L0_0_PCI_CMD_EN_INT_EN;
+       val |= APPL_INTR_EN_L0_0_INT_INT_EN;
        appl_writel(pcie, val, APPL_INTR_EN_L0_0);
 
        val = appl_readl(pcie, APPL_INTR_EN_L1_0_0);
@@ -1813,6 +1827,10 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
        val |= APPL_INTR_EN_L1_0_0_RDLH_LINK_UP_INT_EN;
        appl_writel(pcie, val, APPL_INTR_EN_L1_0_0);
 
+       val = appl_readl(pcie, APPL_INTR_EN_L1_8_0);
+       val |= APPL_INTR_EN_L1_8_EDMA_INT_EN;
+       appl_writel(pcie, val, APPL_INTR_EN_L1_8_0);
+
        /* 110us for both snoop and no-snoop */
        val = FIELD_PREP(PCI_LTR_VALUE_MASK, 110) |
              FIELD_PREP(PCI_LTR_SCALE_MASK, 2) |