]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests: pci_endpoint: Skip IRQ test if IRQ is out of range.
authorChristian Bruel <christian.bruel@foss.st.com>
Mon, 4 Aug 2025 17:09:16 +0000 (19:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:07 +0000 (15:37 -0500)
[ Upstream commit 106fc08b30a2ece49a251b053165a83d41d50fd0 ]

The pci_endpoint_test tests the entire MSI/MSI-X range, which generates
false errors on platforms that do not support the whole range.

Skip the test in such cases and report accordingly.

Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
[mani: reworded description]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20250804170916.3212221-4-christian.bruel@foss.st.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/pci_endpoint/pci_endpoint_test.c

index da0db0e7c9693f11b4975ca0e6830174229983ba..cd9075444c32a13217c716d621754db6fa7cb6f9 100644 (file)
@@ -121,6 +121,8 @@ TEST_F(pci_ep_basic, MSI_TEST)
 
        for (i = 1; i <= 32; i++) {
                pci_ep_ioctl(PCITEST_MSI, i);
+               if (ret == -EINVAL)
+                       SKIP(return, "MSI%d is disabled", i);
                EXPECT_FALSE(ret) TH_LOG("Test failed for MSI%d", i);
        }
 }
@@ -137,6 +139,8 @@ TEST_F(pci_ep_basic, MSIX_TEST)
 
        for (i = 1; i <= 2048; i++) {
                pci_ep_ioctl(PCITEST_MSIX, i);
+               if (ret == -EINVAL)
+                       SKIP(return, "MSI-X%d is disabled", i);
                EXPECT_FALSE(ret) TH_LOG("Test failed for MSI-X%d", i);
        }
 }