[PATCH v2 0/3] Skip subrange map tests on DWC iATU allocation failure

Christian Bruel
2026-03-23T08:15:42Z

For platforms with a limited iATU inbound window entries, pci_epc_set_bar()
might fail to allocate the ATU entries for subrange maps requiring more
than 1 slot.
For the dwc controller, this failure is reported with -ENOSPC in
dw_pcie_ep_set_bar(). In this case, the epf test cannot be run and needs
to be skipped.

For other controllers (Rockchip, RCar, Cadence) the .set_bar functions do
not use this error.

Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
---
Changes in v2:
- Rebased, reordered patches
- Clarified reporting message in selftest
- Renamed STATUS_BAR_SUBRANGE_SETUP_NOPSC STATUS_NO_RESOURCE
- Link to v1: https://lore.kernel.org/r/20260318-skip-bar_subrange-tests-if-enospc-v1-0-f1a49534ebea@foss.st.com

---
Christian Bruel (3):
PCI: endpoint: pci-epf-test: Handle -ENOSPC in subrange_setup
misc: pci_endpoint_test: Handle -ENOSPC in subrange mapping test case
selftests: pci_endpoint: Skip BAR subrange test on -ENOSPC

drivers/misc/pci_endpoint_test.c | 3 ++-
drivers/pci/endpoint/functions/pci-epf-test.c | 3 +++
tools/testing/selftests/pci_endpoint/pci_endpoint_test.c | 2 ++
3 files changed, 7 insertions(+), 1 deletion(-)
---
base-commit: 785f0eb2f85decbe7c1ef9ae922931f0194ffc2e
change-id: 20260318-skip-bar_subrange-tests-if-enospc-c26f03038e92

Best regards,
--
Christian Bruel <christian.bruel@foss.st.com>