diff options
| author | Christian Bruel <christian.bruel@foss.st.com> | 2025-08-04 19:09:14 +0200 |
|---|---|---|
| committer | Manivannan Sadhasivam <mani@kernel.org> | 2025-08-27 18:39:06 +0530 |
| commit | cc8e391067164f45f89b6132a5aaa18c33a0e32b (patch) | |
| tree | 6bd11f80f0b85dbf6e1fc3a12883f10295a169d3 | |
| parent | PCI: endpoint: Drop superfluous pci_epc_features initialization (diff) | |
| download | linux-cc8e391067164f45f89b6132a5aaa18c33a0e32b.tar.gz linux-cc8e391067164f45f89b6132a5aaa18c33a0e32b.zip | |
misc: pci_endpoint_test: Skip IRQ tests if irq is out of range
The pci_endpoint_test tests the 32-bit MSI range. However, the device might
not have all vectors configured. For example, if msi_interrupts is 8 in the
ep function space or if the MSI Multiple Message Capable value is
configured as 4 (maximum 16 vectors).
In this case, do not attempt to run the test to avoid timeouts and directly
return the error value.
Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20250804170916.3212221-2-christian.bruel@foss.st.com
| -rw-r--r-- | drivers/misc/pci_endpoint_test.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index f935175d8bf5..506a2847e5d2 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -436,7 +436,11 @@ static int pci_endpoint_test_msi_irq(struct pci_endpoint_test *test, { struct pci_dev *pdev = test->pdev; u32 val; - int ret; + int irq; + + irq = pci_irq_vector(pdev, msi_num - 1); + if (irq < 0) + return irq; pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_TYPE, msix ? PCITEST_IRQ_TYPE_MSIX : @@ -450,11 +454,7 @@ static int pci_endpoint_test_msi_irq(struct pci_endpoint_test *test, if (!val) return -ETIMEDOUT; - ret = pci_irq_vector(pdev, msi_num - 1); - if (ret < 0) - return ret; - - if (ret != test->last_irq) + if (irq != test->last_irq) return -EIO; return 0; |
