[PATCH 3/3] misc: pci_endpoint_test: Handle -ENOSPC in subrange mapping test case

From: Christian Bruel

Date: Wed Mar 18 2026 - 10:51:41 EST


Return -ENOSPC instead of -EOI when the status reports the NOSPC bit.
This signifies to the pci_endpoint test to skip this test instead of
reporting a failure.

Link: https://lore.kernel.org/linux-pci/20260317152707.GA85951@bhelgaas/T/#m87e4c24173097a0ea70195b71aab294ad8d6c283
Signed-off-by: Christian Bruel <christian.bruel@xxxxxxxxxxx>
---
drivers/misc/pci_endpoint_test.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
index 55e128ed82f00ae13b6fe9768cdbe56adbe8f9da..34ba06fb53f04e48c1c05f4aae85e6ecd03ef447 100644
--- a/drivers/misc/pci_endpoint_test.c
+++ b/drivers/misc/pci_endpoint_test.c
@@ -61,6 +61,7 @@
#define STATUS_BAR_SUBRANGE_SETUP_FAIL BIT(15)
#define STATUS_BAR_SUBRANGE_CLEAR_SUCCESS BIT(16)
#define STATUS_BAR_SUBRANGE_CLEAR_FAIL BIT(17)
+#define STATUS_BAR_SUBRANGE_SETUP_NOSPC BIT(18)

#define PCI_ENDPOINT_TEST_LOWER_SRC_ADDR 0x0c
#define PCI_ENDPOINT_TEST_UPPER_SRC_ADDR 0x10
@@ -476,8 +477,11 @@ static int pci_endpoint_test_bar_subrange_cmd(struct pci_endpoint_test *test,
return -ETIMEDOUT;

status = pci_endpoint_test_readl(test, PCI_ENDPOINT_TEST_STATUS);
- if (status & fail_bit)
+ if (status & fail_bit) {
+ if (status & STATUS_BAR_SUBRANGE_SETUP_NOSPC)
+ return -ENOSPC;
return -EIO;
+ }

if (!(status & ok_bit))
return -EIO;

--
2.34.1