From: Niklas Cassel Date: Thu, 12 Mar 2026 13:02:38 +0000 (+0100) Subject: selftests: pci_endpoint: Skip reserved BARs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e022f0c72c7f67fe79de03e71d839418073490a5;p=thirdparty%2Fkernel%2Flinux.git selftests: pci_endpoint: Skip reserved BARs Running a test against a reserved BAR will result in the pci-epf-test driver returning -ENOBUFS. Make sure that the pci_endpoint_test selftest will return skip instead of failure or success for reserved BARs. Signed-off-by: Niklas Cassel Signed-off-by: Manivannan Sadhasivam Tested-by: Manikanta Maddireddy Tested-by: Koichiro Den Reviewed-by: Manikanta Maddireddy Reviewed-by: Frank Li Link: https://patch.msgid.link/20260312130229.2282001-22-cassel@kernel.org --- diff --git a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c index e0dbbb2af8c7a..c417fb3a198b2 100644 --- a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c +++ b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c @@ -67,6 +67,8 @@ TEST_F(pci_ep_bar, BAR_TEST) pci_ep_ioctl(PCITEST_BAR, variant->barno); if (ret == -ENODATA) SKIP(return, "BAR is disabled"); + if (ret == -ENOBUFS) + SKIP(return, "BAR is reserved"); EXPECT_FALSE(ret) TH_LOG("Test failed for BAR%d", variant->barno); } @@ -84,6 +86,8 @@ TEST_F(pci_ep_bar, BAR_SUBRANGE_TEST) SKIP(return, "BAR is test register space"); if (ret == -EOPNOTSUPP) SKIP(return, "Subrange map is not supported"); + if (ret == -ENOBUFS) + SKIP(return, "BAR is reserved"); EXPECT_FALSE(ret) TH_LOG("Test failed for BAR%d", variant->barno); }