public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: dwc: rcar-gen4-ep: Program Resizable BARs and drop 1MiB BAR limit
@ 2025-10-23  7:22 Koichiro Den
  2026-02-10 10:25 ` Niklas Cassel
  0 siblings, 1 reply; 5+ messages in thread
From: Koichiro Den @ 2025-10-23  7:22 UTC (permalink / raw)
  To: linux-pci, linux-renesas-soc, linux-kernel
  Cc: marek.vasut+renesas, yoshihiro.shimoda.uh, lpieralisi,
	kwilczynski, mani, robh, bhelgaas, geert+renesas, magnus.damm

R-Car Gen4 (S4) exposes BAR0 and BAR2 as Resizable BARs. Program them
accordingly by using dw_pcie_ep_set_bar_resizable() instead of the
programmable BAR path.

Before this change the driver left the Resizable BAR capability
untouched and only wrote the BAR register, so the RC enumerated BAR0/2
as 1 MiB regardless of the size requested by the endpoint function. For
example, configuring a 2 MiB window for pci-epf-vntb still produced:

  ntb_hw_epf 0000:01:00.0: \
  Size:0x0000000000200000 is greater than the MW size 0x0000000000100000

Program the Resizable BAR control so the RC sees the requested size and
ntb_transport can use larger memory windows.

Signed-off-by: Koichiro Den <den@valinux.co.jp>
---
 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 80778917d2dd..dbad741b8286 100644
--- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
+++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
@@ -421,7 +421,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 = {
 	.msi_capable = true,
+	.bar[BAR_0] = { .type = BAR_RESIZABLE, },
 	.bar[BAR_1] = { .type = BAR_RESERVED, },
+	.bar[BAR_2] = { .type = BAR_RESIZABLE, },
 	.bar[BAR_3] = { .type = BAR_RESERVED, },
 	.bar[BAR_4] = { .type = BAR_FIXED, .fixed_size = 256 },
 	.bar[BAR_5] = { .type = BAR_RESERVED, },
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI: dwc: rcar-gen4-ep: Program Resizable BARs and drop 1MiB BAR limit
  2025-10-23  7:22 [PATCH] PCI: dwc: rcar-gen4-ep: Program Resizable BARs and drop 1MiB BAR limit Koichiro Den
@ 2026-02-10 10:25 ` Niklas Cassel
  2026-02-10 15:31   ` Koichiro Den
  0 siblings, 1 reply; 5+ messages in thread
From: Niklas Cassel @ 2026-02-10 10:25 UTC (permalink / raw)
  To: Koichiro Den
  Cc: linux-pci, linux-renesas-soc, linux-kernel, marek.vasut+renesas,
	yoshihiro.shimoda.uh, lpieralisi, kwilczynski, mani, robh,
	bhelgaas, geert+renesas, magnus.damm

On Thu, Oct 23, 2025 at 04:22:17PM +0900, Koichiro Den wrote:
> R-Car Gen4 (S4) exposes BAR0 and BAR2 as Resizable BARs. Program them
> accordingly by using dw_pcie_ep_set_bar_resizable() instead of the
> programmable BAR path.
> 
> Before this change the driver left the Resizable BAR capability
> untouched and only wrote the BAR register, so the RC enumerated BAR0/2
> as 1 MiB regardless of the size requested by the endpoint function. For
> example, configuring a 2 MiB window for pci-epf-vntb still produced:
> 
>   ntb_hw_epf 0000:01:00.0: \
>   Size:0x0000000000200000 is greater than the MW size 0x0000000000100000
> 
> Program the Resizable BAR control so the RC sees the requested size and
> ntb_transport can use larger memory windows.
> 
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
> ---
>  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 80778917d2dd..dbad741b8286 100644
> --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> @@ -421,7 +421,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 = {
>  	.msi_capable = true,
> +	.bar[BAR_0] = { .type = BAR_RESIZABLE, },
>  	.bar[BAR_1] = { .type = BAR_RESERVED, },
> +	.bar[BAR_2] = { .type = BAR_RESIZABLE, },
>  	.bar[BAR_3] = { .type = BAR_RESERVED, },
>  	.bar[BAR_4] = { .type = BAR_FIXED, .fixed_size = 256 },
>  	.bar[BAR_5] = { .type = BAR_RESERVED, },
> -- 
> 2.48.1
> 

Reviewed-by: Niklas Cassel <cassel@kernel.org>

Considering that this patch has not been picked up yet,
perhaps resend it using [PATCH RESEND].


Kind regards,
Niklas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI: dwc: rcar-gen4-ep: Program Resizable BARs and drop 1MiB BAR limit
  2026-02-10 10:25 ` Niklas Cassel
@ 2026-02-10 15:31   ` Koichiro Den
  2026-02-10 15:33     ` Niklas Cassel
  0 siblings, 1 reply; 5+ messages in thread
From: Koichiro Den @ 2026-02-10 15:31 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: linux-pci, linux-renesas-soc, linux-kernel, marek.vasut+renesas,
	yoshihiro.shimoda.uh, lpieralisi, kwilczynski, mani, robh,
	bhelgaas, geert+renesas, magnus.damm

On Tue, Feb 10, 2026 at 11:25:16AM +0100, Niklas Cassel wrote:
> On Thu, Oct 23, 2025 at 04:22:17PM +0900, Koichiro Den wrote:
> > R-Car Gen4 (S4) exposes BAR0 and BAR2 as Resizable BARs. Program them
> > accordingly by using dw_pcie_ep_set_bar_resizable() instead of the
> > programmable BAR path.
> > 
> > Before this change the driver left the Resizable BAR capability
> > untouched and only wrote the BAR register, so the RC enumerated BAR0/2
> > as 1 MiB regardless of the size requested by the endpoint function. For
> > example, configuring a 2 MiB window for pci-epf-vntb still produced:
> > 
> >   ntb_hw_epf 0000:01:00.0: \
> >   Size:0x0000000000200000 is greater than the MW size 0x0000000000100000
> > 
> > Program the Resizable BAR control so the RC sees the requested size and
> > ntb_transport can use larger memory windows.
> > 
> > Signed-off-by: Koichiro Den <den@valinux.co.jp>
> > ---
> >  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 80778917d2dd..dbad741b8286 100644
> > --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> > +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> > @@ -421,7 +421,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 = {
> >  	.msi_capable = true,
> > +	.bar[BAR_0] = { .type = BAR_RESIZABLE, },
> >  	.bar[BAR_1] = { .type = BAR_RESERVED, },
> > +	.bar[BAR_2] = { .type = BAR_RESIZABLE, },
> >  	.bar[BAR_3] = { .type = BAR_RESERVED, },
> >  	.bar[BAR_4] = { .type = BAR_FIXED, .fixed_size = 256 },
> >  	.bar[BAR_5] = { .type = BAR_RESERVED, },
> > -- 
> > 2.48.1
> > 
> 
> Reviewed-by: Niklas Cassel <cassel@kernel.org>
> 
> Considering that this patch has not been picked up yet,
> perhaps resend it using [PATCH RESEND].

Thanks for the Reviewed-by. As almost four months have passed, in hindsight the
commit message sounds a bit too awkward now..
I'd like to update it to at least remove ntb-specific wording and make it more
compact and concise, like this:

  PCI: dwc: rcar-gen4-ep: Mark BAR0 and BAR2 as Resizable BARs

  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.

If this looks good to you, would it be okay for me to keep the Reviewed-by
tag? There will be no code changes, only this commit message rewording in
the RESEND.

Best regards,
Koichiro

> 
> 
> Kind regards,
> Niklas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI: dwc: rcar-gen4-ep: Program Resizable BARs and drop 1MiB BAR limit
  2026-02-10 15:31   ` Koichiro Den
@ 2026-02-10 15:33     ` Niklas Cassel
  2026-02-10 15:56       ` Koichiro Den
  0 siblings, 1 reply; 5+ messages in thread
From: Niklas Cassel @ 2026-02-10 15:33 UTC (permalink / raw)
  To: Koichiro Den
  Cc: linux-pci, linux-renesas-soc, linux-kernel, marek.vasut+renesas,
	yoshihiro.shimoda.uh, lpieralisi, kwilczynski, mani, robh,
	bhelgaas, geert+renesas, magnus.damm

On Wed, Feb 11, 2026 at 12:31:21AM +0900, Koichiro Den wrote:
> On Tue, Feb 10, 2026 at 11:25:16AM +0100, Niklas Cassel wrote:
> > On Thu, Oct 23, 2025 at 04:22:17PM +0900, Koichiro Den wrote:
> > > R-Car Gen4 (S4) exposes BAR0 and BAR2 as Resizable BARs. Program them
> > > accordingly by using dw_pcie_ep_set_bar_resizable() instead of the
> > > programmable BAR path.
> > > 
> > > Before this change the driver left the Resizable BAR capability
> > > untouched and only wrote the BAR register, so the RC enumerated BAR0/2
> > > as 1 MiB regardless of the size requested by the endpoint function. For
> > > example, configuring a 2 MiB window for pci-epf-vntb still produced:
> > > 
> > >   ntb_hw_epf 0000:01:00.0: \
> > >   Size:0x0000000000200000 is greater than the MW size 0x0000000000100000
> > > 
> > > Program the Resizable BAR control so the RC sees the requested size and
> > > ntb_transport can use larger memory windows.
> > > 
> > > Signed-off-by: Koichiro Den <den@valinux.co.jp>
> > > ---
> > >  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 80778917d2dd..dbad741b8286 100644
> > > --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> > > +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> > > @@ -421,7 +421,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 = {
> > >  	.msi_capable = true,
> > > +	.bar[BAR_0] = { .type = BAR_RESIZABLE, },
> > >  	.bar[BAR_1] = { .type = BAR_RESERVED, },
> > > +	.bar[BAR_2] = { .type = BAR_RESIZABLE, },
> > >  	.bar[BAR_3] = { .type = BAR_RESERVED, },
> > >  	.bar[BAR_4] = { .type = BAR_FIXED, .fixed_size = 256 },
> > >  	.bar[BAR_5] = { .type = BAR_RESERVED, },
> > > -- 
> > > 2.48.1
> > > 
> > 
> > Reviewed-by: Niklas Cassel <cassel@kernel.org>
> > 
> > Considering that this patch has not been picked up yet,
> > perhaps resend it using [PATCH RESEND].
> 
> Thanks for the Reviewed-by. As almost four months have passed, in hindsight the
> commit message sounds a bit too awkward now..
> I'd like to update it to at least remove ntb-specific wording and make it more
> compact and concise, like this:
> 
>   PCI: dwc: rcar-gen4-ep: Mark BAR0 and BAR2 as Resizable BARs
> 
>   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.
> 
> If this looks good to you, would it be okay for me to keep the Reviewed-by
> tag? There will be no code changes, only this commit message rewording in
> the RESEND.

Looks good to me, and you can keep the R-b tag, but if you update the
commit message, then you should probably send it as V2.


Kind regards,
Niklas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI: dwc: rcar-gen4-ep: Program Resizable BARs and drop 1MiB BAR limit
  2026-02-10 15:33     ` Niklas Cassel
@ 2026-02-10 15:56       ` Koichiro Den
  0 siblings, 0 replies; 5+ messages in thread
From: Koichiro Den @ 2026-02-10 15:56 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: linux-pci, linux-renesas-soc, linux-kernel, marek.vasut+renesas,
	yoshihiro.shimoda.uh, lpieralisi, kwilczynski, mani, robh,
	bhelgaas, geert+renesas, magnus.damm

On Tue, Feb 10, 2026 at 04:33:32PM +0100, Niklas Cassel wrote:
> On Wed, Feb 11, 2026 at 12:31:21AM +0900, Koichiro Den wrote:
> > On Tue, Feb 10, 2026 at 11:25:16AM +0100, Niklas Cassel wrote:
> > > On Thu, Oct 23, 2025 at 04:22:17PM +0900, Koichiro Den wrote:
> > > > R-Car Gen4 (S4) exposes BAR0 and BAR2 as Resizable BARs. Program them
> > > > accordingly by using dw_pcie_ep_set_bar_resizable() instead of the
> > > > programmable BAR path.
> > > > 
> > > > Before this change the driver left the Resizable BAR capability
> > > > untouched and only wrote the BAR register, so the RC enumerated BAR0/2
> > > > as 1 MiB regardless of the size requested by the endpoint function. For
> > > > example, configuring a 2 MiB window for pci-epf-vntb still produced:
> > > > 
> > > >   ntb_hw_epf 0000:01:00.0: \
> > > >   Size:0x0000000000200000 is greater than the MW size 0x0000000000100000
> > > > 
> > > > Program the Resizable BAR control so the RC sees the requested size and
> > > > ntb_transport can use larger memory windows.
> > > > 
> > > > Signed-off-by: Koichiro Den <den@valinux.co.jp>
> > > > ---
> > > >  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 80778917d2dd..dbad741b8286 100644
> > > > --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> > > > +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> > > > @@ -421,7 +421,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 = {
> > > >  	.msi_capable = true,
> > > > +	.bar[BAR_0] = { .type = BAR_RESIZABLE, },
> > > >  	.bar[BAR_1] = { .type = BAR_RESERVED, },
> > > > +	.bar[BAR_2] = { .type = BAR_RESIZABLE, },
> > > >  	.bar[BAR_3] = { .type = BAR_RESERVED, },
> > > >  	.bar[BAR_4] = { .type = BAR_FIXED, .fixed_size = 256 },
> > > >  	.bar[BAR_5] = { .type = BAR_RESERVED, },
> > > > -- 
> > > > 2.48.1
> > > > 
> > > 
> > > Reviewed-by: Niklas Cassel <cassel@kernel.org>
> > > 
> > > Considering that this patch has not been picked up yet,
> > > perhaps resend it using [PATCH RESEND].
> > 
> > Thanks for the Reviewed-by. As almost four months have passed, in hindsight the
> > commit message sounds a bit too awkward now..
> > I'd like to update it to at least remove ntb-specific wording and make it more
> > compact and concise, like this:
> > 
> >   PCI: dwc: rcar-gen4-ep: Mark BAR0 and BAR2 as Resizable BARs
> > 
> >   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.
> > 
> > If this looks good to you, would it be okay for me to keep the Reviewed-by
> > tag? There will be no code changes, only this commit message rewording in
> > the RESEND.
> 
> Looks good to me, and you can keep the R-b tag, but if you update the
> commit message, then you should probably send it as V2.

Will do, thanks for the confirmation.

Koichiro

> 
> 
> Kind regards,
> Niklas

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-10 15:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-23  7:22 [PATCH] PCI: dwc: rcar-gen4-ep: Program Resizable BARs and drop 1MiB BAR limit Koichiro Den
2026-02-10 10:25 ` Niklas Cassel
2026-02-10 15:31   ` Koichiro Den
2026-02-10 15:33     ` Niklas Cassel
2026-02-10 15:56       ` Koichiro Den

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox