]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: endpoint: Do not mark the BAR succeeding a 64-bit BAR as BAR_RESERVED
authorNiklas Cassel <cassel@kernel.org>
Thu, 12 Mar 2026 13:02:29 +0000 (14:02 +0100)
committerManivannan Sadhasivam <mani@kernel.org>
Sun, 15 Mar 2026 16:34:22 +0000 (22:04 +0530)
A BAR that can only be configured as a 64-bit BAR by an EPC driver is
marked as such using the "only_64bit" flag.

Currently, the documentation says that an EPC driver should explicitly
mark the BAR succeeding an "only_64bit" BAR as BAR_RESERVED.

However, a 64-bit BAR will always take up two BARs. It is thus redundant
to mark both BARs.

pci_epc_get_next_free_bar() already skips the BAR succeeding a "only_64bit"
BAR, regardless if the succeeding BAR is marked as BAR_RESERVED or not.

Thus, drop the BAR_RESERVED for a BAR succeeding a "only_64bit" BAR.
No functional changes.

Suggested-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20260312130229.2282001-13-cassel@kernel.org
drivers/pci/controller/dwc/pci-layerscape-ep.c
drivers/pci/controller/dwc/pcie-keembay.c
drivers/pci/controller/dwc/pcie-qcom-ep.c
drivers/pci/controller/dwc/pcie-tegra194.c
drivers/pci/controller/dwc/pcie-uniphier-ep.c
drivers/pci/controller/pcie-rcar-ep.c
include/linux/pci-epc.h

index a4a800699f898db8f149e4541bc9886fe6dd81de..79d226e0cc804285da9927933558645977bc381d 100644 (file)
@@ -251,9 +251,7 @@ static int __init ls_pcie_ep_probe(struct platform_device *pdev)
        pci->ops = pcie->drvdata->dw_pcie_ops;
 
        ls_epc->bar[BAR_2].only_64bit = true;
-       ls_epc->bar[BAR_3].type = BAR_RESERVED;
        ls_epc->bar[BAR_4].only_64bit = true;
-       ls_epc->bar[BAR_5].type = BAR_RESERVED;
        ls_epc->linkup_notifier = true;
 
        pcie->pci = pci;
index 2666a9c3d67e71da1061a485b3dc4d321c43e18d..7cf2c312ecec20df49df2a8bcb2be81f630cc39b 100644 (file)
@@ -313,11 +313,8 @@ static const struct pci_epc_features keembay_pcie_epc_features = {
        .msi_capable            = true,
        .msix_capable           = true,
        .bar[BAR_0]             = { .only_64bit = true, },
-       .bar[BAR_1]             = { .type = BAR_RESERVED, },
        .bar[BAR_2]             = { .only_64bit = true, },
-       .bar[BAR_3]             = { .type = BAR_RESERVED, },
        .bar[BAR_4]             = { .only_64bit = true, },
-       .bar[BAR_5]             = { .type = BAR_RESERVED, },
        .align                  = SZ_16K,
 };
 
index 18460f01b2c67c3aa2383fee8890dc75d1fb6b15..ffb4409c0468c57263a7c78669116d63dae70d5f 100644 (file)
@@ -850,9 +850,7 @@ static const struct pci_epc_features qcom_pcie_epc_features = {
        .msi_capable = true,
        .align = SZ_4K,
        .bar[BAR_0] = { .only_64bit = true, },
-       .bar[BAR_1] = { .type = BAR_RESERVED, },
        .bar[BAR_2] = { .only_64bit = true, },
-       .bar[BAR_3] = { .type = BAR_RESERVED, },
 };
 
 static const struct pci_epc_features *
index 06571d806ab31fa7d6e2866db1c895764220c8a1..f1f70fb824b25f9bc8e99704b1cafb8eecc5a6b2 100644 (file)
@@ -1993,7 +1993,6 @@ static const struct pci_epc_features tegra_pcie_epc_features = {
        .msi_capable = true,
        .bar[BAR_0] = { .type = BAR_FIXED, .fixed_size = SZ_1M,
                        .only_64bit = true, },
-       .bar[BAR_1] = { .type = BAR_RESERVED, },
        .bar[BAR_2] = { .type = BAR_RESERVED, },
        .bar[BAR_3] = { .type = BAR_RESERVED, },
        .bar[BAR_4] = { .type = BAR_RESERVED, },
index d52753060970fa41ee5696822ac7bcec36386fb3..b7020131f6262d6cae00f4772908415264e05b43 100644 (file)
@@ -426,9 +426,7 @@ static const struct uniphier_pcie_ep_soc_data uniphier_pro5_data = {
                .msix_capable = false,
                .align = 1 << 16,
                .bar[BAR_0] = { .only_64bit = true, },
-               .bar[BAR_1] = { .type = BAR_RESERVED, },
                .bar[BAR_2] = { .only_64bit = true, },
-               .bar[BAR_3] = { .type = BAR_RESERVED, },
                .bar[BAR_4] = { .type = BAR_RESERVED, },
                .bar[BAR_5] = { .type = BAR_RESERVED, },
        },
@@ -445,11 +443,8 @@ static const struct uniphier_pcie_ep_soc_data uniphier_nx1_data = {
                .msix_capable = false,
                .align = 1 << 12,
                .bar[BAR_0] = { .only_64bit = true, },
-               .bar[BAR_1] = { .type = BAR_RESERVED, },
                .bar[BAR_2] = { .only_64bit = true, },
-               .bar[BAR_3] = { .type = BAR_RESERVED, },
                .bar[BAR_4] = { .only_64bit = true, },
-               .bar[BAR_5] = { .type = BAR_RESERVED, },
        },
 };
 
index 657875ef4657f8f785884b7c8969af2c0d008626..c2da8ac1f2e85a08805304ca4e6068fcce6fda74 100644 (file)
@@ -440,13 +440,10 @@ static const struct pci_epc_features rcar_pcie_epc_features = {
        /* use 64-bit BARs so mark BAR[1,3,5] as reserved */
        .bar[BAR_0] = { .type = BAR_FIXED, .fixed_size = 128,
                        .only_64bit = true, },
-       .bar[BAR_1] = { .type = BAR_RESERVED, },
        .bar[BAR_2] = { .type = BAR_FIXED, .fixed_size = 256,
                        .only_64bit = true, },
-       .bar[BAR_3] = { .type = BAR_RESERVED, },
        .bar[BAR_4] = { .type = BAR_FIXED, .fixed_size = 256,
                        .only_64bit = true, },
-       .bar[BAR_5] = { .type = BAR_RESERVED, },
 };
 
 static const struct pci_epc_features*
index c021c7af175fd024302778ae1322a52794913b06..c981ea7d52c02924426630f2507cf2747ed016d4 100644 (file)
@@ -206,8 +206,7 @@ enum pci_epc_bar_type {
  * @fixed_size: the fixed size, only applicable if type is BAR_FIXED_MASK.
  * @only_64bit: if true, an EPF driver is not allowed to choose if this BAR
  *             should be configured as 32-bit or 64-bit, the EPF driver must
- *             configure this BAR as 64-bit. Additionally, the BAR succeeding
- *             this BAR must be set to type BAR_RESERVED.
+ *             configure this BAR as 64-bit.
  *
  *             only_64bit should not be set on a BAR of type BAR_RESERVED.
  *             (If BARx is a 64-bit BAR that an EPF driver is not allowed to