Re: [PATCH] PCI: endpoint: pci-epf-test: Roll back BAR mapping when subrange setup fails

Niklas Cassel
2026-03-17T10:12:50Z

On Tue, Mar 17, 2026 at 11:01:28AM +0100, Christian Bruel wrote:
>
>
> >
> > So we will need to add a SKIP ENOSPC case in TEST_F(pci_ep_bar,
> > BAR_SUBRANGE_TEST)
> >
> Re-checking this, no need for ENOSPC test. The real condition would be
> EBUSY. Which can be handled nicely in a stm32 ep_map_addr helper.

Are you sure that it returns EBUSY and not ENOSPC?

I would have expected the error to be ENOSPC when there are no free inbound
window:
https://github.com/torvalds/linux/blob/v7.0-rc4/drivers/pci/controller/dwc/pcie-designware-ep.c#L307-L312

I think a SKIP ENOSPC case in TEST_F(pci_ep_bar, BAR_SUBRANGE_TEST) in
a better solution than modifying a STM32 specific helper.

Because the former will ensure that we skip/handle this issue on all SoCs
with few inbound windows, not only on STM32.

Kind regards,
Niklas