[PATCH 3/3] selftests: pci_endpoint: Skip doorbell test when unsupported

Koichiro Den posted 3 patches 1 month, 2 weeks ago
[PATCH 3/3] selftests: pci_endpoint: Skip doorbell test when unsupported
Posted by Koichiro Den 1 month, 2 weeks ago
PCITEST_DOORBELL may return -EOPNOTSUPP when the endpoint does not
advertise CAP_DYNAMIC_INBOUND_MAPPING.

Treat this like other optional capabilities and skip the doorbell test
instead of reporting a failure.

Suggested-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Koichiro Den <den@valinux.co.jp>
---
 tools/testing/selftests/pci_endpoint/pci_endpoint_test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
index eecb776c33af..e0dbbb2af8c7 100644
--- a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
+++ b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
@@ -276,6 +276,8 @@ TEST_F(pcie_ep_doorbell, DOORBELL_TEST)
 	ASSERT_EQ(0, ret) TH_LOG("Can't set AUTO IRQ type");
 
 	pci_ep_ioctl(PCITEST_DOORBELL, 0);
+	if (ret == -EOPNOTSUPP)
+		SKIP(return, "Doorbell test is not supported");
 	EXPECT_FALSE(ret) TH_LOG("Test failed for Doorbell\n");
 }
 TEST_HARNESS_MAIN
-- 
2.51.0
Re: [PATCH 3/3] selftests: pci_endpoint: Skip doorbell test when unsupported
Posted by Niklas Cassel 1 month, 2 weeks ago
On Mon, Feb 16, 2026 at 12:03:34AM +0900, Koichiro Den wrote:
> PCITEST_DOORBELL may return -EOPNOTSUPP when the endpoint does not
> advertise CAP_DYNAMIC_INBOUND_MAPPING.
> 
> Treat this like other optional capabilities and skip the doorbell test
> instead of reporting a failure.
> 
> Suggested-by: Niklas Cassel <cassel@kernel.org>
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
> ---

Reviewed-by: Niklas Cassel <cassel@kernel.org>


Thank you for doing this work!