Re: [PATCH v2] PCI: dwc: rcar-gen4-ep: Mark BAR0 and BAR2 as Resizable BARs
From: Koichiro Den
Date: Tue Mar 03 2026 - 00:12:48 EST
On Mon, Mar 02, 2026 at 04:31:50PM -0600, Bjorn Helgaas wrote:
> On Wed, Feb 11, 2026 at 01:03:15AM +0900, Koichiro Den wrote:
> > R-Car Gen4 (S4) implements the PCIe Resizable BAR capability for BAR0 and
> > BAR2. Advertise them as BAR_RESIZABLE so EPF-requested BAR sizes are
> > reflected to the host.
> >
> > Reviewed-by: Niklas Cassel <cassel@xxxxxxxxxx>
> > Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>
> > ---
> > Changes since v1:
> > - Reword commit message only, no code changes.
> > - Rebased onto pci/controller/dwc as of 2026-02-11
> >
> > v1: https://lore.kernel.org/linux-pci/20251023072217.901888-1-den@xxxxxxxxxxxxx
> >
> > drivers/pci/controller/dwc/pcie-rcar-gen4.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> > index a6912e85e4dd..3d4a889e38cc 100644
> > --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> > +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> > @@ -422,7 +422,9 @@ static int rcar_gen4_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
> > static const struct pci_epc_features rcar_gen4_pcie_epc_features = {
> > DWC_EPC_COMMON_FEATURES,
> > .msi_capable = true,
> > + .bar[BAR_0] = { .type = BAR_RESIZABLE, },
> > .bar[BAR_1] = { .type = BAR_RESERVED, },
> > + .bar[BAR_2] = { .type = BAR_RESIZABLE, },
>
> I guess the "Resizable" property is not something that is discoverable
> at runtime?
>
> You mention the Resizable BAR Capability, so I wondered if the driver
> could use that to figure this out.
As I understand it, it should be discoverable on DesignWare EPC, since a BAR
configured with a resizable sizing scheme results in a corresponding Resizable
BAR capabilioty/control pair, and the BAR index is there.
>
> * @BAR_RESIZABLE: The BAR implements the PCI-SIG Resizable BAR Capability.
> * NOTE: An EPC driver can currently only set a single supported
> * size.
>
> Is this comment about the single supported size still accurate?
Yes, I believe so. The comment still seems to reflect the current
implementation.
Niklas, please feel free to correct me here if I'm missing something.
Best regards,
Koichiro
>
> > .bar[BAR_3] = { .type = BAR_RESERVED, },
> > .bar[BAR_4] = { .type = BAR_FIXED, .fixed_size = 256 },
> > .bar[BAR_5] = { .type = BAR_RESERVED, },
> > --
> > 2.51.0
> >