Re: [PATCH 2/4] PCI: tegra194: Make BAR0 programmable and remove 1MB size limit

From: Niklas Cassel

Date: Wed Feb 25 2026 - 12:32:15 EST


On Mon, Feb 23, 2026 at 01:04:54AM +0530, Manikanta Maddireddy wrote:
> BAR0 is capable of supporting various sizes via DBI2 BAR registers
> programmed in dw_pcie_ep_set_bar_programmable(). Remove the 1MB fixed
> size from pci_epc_features and set the BAR type to BAR_PROGRAMMABLE.
>
> Signed-off-by: Manikanta Maddireddy <mmaddireddy@xxxxxxxxxx>
> ---
> drivers/pci/controller/dwc/pcie-tegra194.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index 4a3b50322204..3c84a230dc79 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> @@ -2000,11 +2000,11 @@ static int tegra_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
> return 0;
> }
>
> +/* Tegra EP: BAR0 = 64-bit programmable BAR */
> static const struct pci_epc_features tegra_pcie_epc_features = {
> .linkup_notifier = true,
> .msi_capable = true,
> - .bar[BAR_0] = { .type = BAR_FIXED, .fixed_size = SZ_1M,
> - .only_64bit = true, },
> + .bar[BAR_0] = { .type = BAR_PROGRAMMABLE, .only_64bit = true, },

If BAR_PROGRAMMABLE, you don't strictly need .type at all, as
BAR_PROGRAMMABLE is (and has always been) the default, defined as value 0.
(So you could simply drop .type from the initializer.)



Are you sure that the BAR is Programmable and not Resizable though?
Because historically, a lot of BARs were defined as Fixed size BARs with
size 1 MB, because there was no Resizable BAR support yet
(the minimum size of a Resizable BAR is 1 MB).

See e.g.:
6a6b66f7e607 ("PCI: keystone: Describe Resizable BARs as Resizable BARs")
aba2b17810d7 ("PCI: dw-rockchip: Describe Resizable BARs as Resizable BARs")


One easy way to check this is to just do (on the host side):

# lspci -s 0000:01:00.0 -vvv | grep Resizable
Capabilities: [2e8 v1] Physical Resizable BAR

Here you see e.g. that RK3588 based EP implements the "Physical Resizable BAR"
capability.
(Replace 0000:01:00.0 with the BDF of your Tegra based EP.)


Kind regards,
Niklas