On Thu, Mar 19, 2026 at 10:28:41AM +0900, Koichiro Den wrote:
> On Wed, Mar 18, 2026 at 03:46:27PM +0100, Christian Bruel wrote:
> > Handle -ENOSPC error. If the number of available inbound ATU entries is
> > insufficient to map the subrange, skip the test instead of failing.
> >
> > Link:
> > https://lore.kernel.org/linux-pci/20260317152707.GA85951@bhelgaas/T/#m87e4c24173097a0ea70195b71aab294ad8d6c283
> > Signed-off-by: Christian Bruel <[email protected]>
> > ---
> > 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
> > c417fb3a198b2d92c3060938c23807cc8bea5573..8ea2fda4539d11eb22b22800a7cb8bbaa99c91ba
> > 100644
> > --- a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
> > +++ b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
> > @@ -88,6 +88,8 @@ TEST_F(pci_ep_bar, BAR_SUBRANGE_TEST)
> > SKIP(return, "Subrange map is not supported");
> > if (ret == -ENOBUFS)
> > SKIP(return, "BAR is reserved");
> > + if (ret == -ENOSPC)
> > + SKIP(return, "Not enough ATU entries to allocate subrange");
>
> Thank you for handling this!
>
> pci_endpoint_test_bar_subrange() can also return -ENOSPC locally:
> https://github.com/torvalds/linux/blob/v7.0-rc4/drivers/misc/pci_endpoint_test.c#L538
> While that is a different resource limit case, I think it would still be
> reasonable to treat it as SKIP as well.
sub_size = bar_size / nsub;
if (sub_size < sizeof(u32)) {
ret = -ENOSPC;
goto out_clear;
}
What is this test for anyway?
If sub_size < 4 ?
return -ENOSPACE ?
ENOSPC seem like a weird return for this.
Wouldn't EINVAL be a better return code for this?
Kind regards,
Niklas