]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PCI: tegra194: Fix broken tegra_pcie_ep_raise_msi_irq()
authorNiklas Cassel <cassel@kernel.org>
Mon, 22 Sep 2025 14:08:24 +0000 (16:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:21:48 +0000 (16:21 +0200)
commit b640d42a6ac9ba01abe65ec34f7c73aaf6758ab8 upstream.

The pci_epc_raise_irq() supplies a MSI or MSI-X interrupt number in range
(1-N), as per the pci_epc_raise_irq() kdoc, where N is 32 for MSI.

But tegra_pcie_ep_raise_msi_irq() incorrectly uses the interrupt number as
the MSI vector. This causes wrong MSI vector to be triggered, leading to
the failure of PCI endpoint Kselftest MSI_TEST test case.

To fix this issue, convert the interrupt number to MSI vector.

Fixes: c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20250922140822.519796-6-cassel@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/controller/dwc/pcie-tegra194.c

index 3703ea0d90c28fb09a7ffe3103f3964b0b2da408..0046983e5ab89784939362400eb9ce7cad47e2a6 100644 (file)
@@ -1839,10 +1839,10 @@ static int tegra_pcie_ep_raise_legacy_irq(struct tegra_pcie_dw *pcie, u16 irq)
 
 static int tegra_pcie_ep_raise_msi_irq(struct tegra_pcie_dw *pcie, u16 irq)
 {
-       if (unlikely(irq > 31))
+       if (unlikely(irq > 32))
                return -EINVAL;
 
-       appl_writel(pcie, BIT(irq), APPL_MSI_CTRL_1);
+       appl_writel(pcie, BIT(irq - 1), APPL_MSI_CTRL_1);
 
        return 0;
 }