Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PCI: endpoint: Do not mark the BAR succeeding a 64-bit BAR as BAR_RESERVED

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

authored by

Niklas Cassel and committed by
Manivannan Sadhasivam
0834d6f4 0b74f7d7

+1 -18
-2
drivers/pci/controller/dwc/pci-layerscape-ep.c
··· 251 251 pci->ops = pcie->drvdata->dw_pcie_ops; 252 252 253 253 ls_epc->bar[BAR_2].only_64bit = true; 254 - ls_epc->bar[BAR_3].type = BAR_RESERVED; 255 254 ls_epc->bar[BAR_4].only_64bit = true; 256 - ls_epc->bar[BAR_5].type = BAR_RESERVED; 257 255 ls_epc->linkup_notifier = true; 258 256 259 257 pcie->pci = pci;
-3
drivers/pci/controller/dwc/pcie-keembay.c
··· 313 313 .msi_capable = true, 314 314 .msix_capable = true, 315 315 .bar[BAR_0] = { .only_64bit = true, }, 316 - .bar[BAR_1] = { .type = BAR_RESERVED, }, 317 316 .bar[BAR_2] = { .only_64bit = true, }, 318 - .bar[BAR_3] = { .type = BAR_RESERVED, }, 319 317 .bar[BAR_4] = { .only_64bit = true, }, 320 - .bar[BAR_5] = { .type = BAR_RESERVED, }, 321 318 .align = SZ_16K, 322 319 }; 323 320
-2
drivers/pci/controller/dwc/pcie-qcom-ep.c
··· 850 850 .msi_capable = true, 851 851 .align = SZ_4K, 852 852 .bar[BAR_0] = { .only_64bit = true, }, 853 - .bar[BAR_1] = { .type = BAR_RESERVED, }, 854 853 .bar[BAR_2] = { .only_64bit = true, }, 855 - .bar[BAR_3] = { .type = BAR_RESERVED, }, 856 854 }; 857 855 858 856 static const struct pci_epc_features *
-1
drivers/pci/controller/dwc/pcie-tegra194.c
··· 1993 1993 .msi_capable = true, 1994 1994 .bar[BAR_0] = { .type = BAR_FIXED, .fixed_size = SZ_1M, 1995 1995 .only_64bit = true, }, 1996 - .bar[BAR_1] = { .type = BAR_RESERVED, }, 1997 1996 .bar[BAR_2] = { .type = BAR_RESERVED, }, 1998 1997 .bar[BAR_3] = { .type = BAR_RESERVED, }, 1999 1998 .bar[BAR_4] = { .type = BAR_RESERVED, },
-5
drivers/pci/controller/dwc/pcie-uniphier-ep.c
··· 426 426 .msix_capable = false, 427 427 .align = 1 << 16, 428 428 .bar[BAR_0] = { .only_64bit = true, }, 429 - .bar[BAR_1] = { .type = BAR_RESERVED, }, 430 429 .bar[BAR_2] = { .only_64bit = true, }, 431 - .bar[BAR_3] = { .type = BAR_RESERVED, }, 432 430 .bar[BAR_4] = { .type = BAR_RESERVED, }, 433 431 .bar[BAR_5] = { .type = BAR_RESERVED, }, 434 432 }, ··· 443 445 .msix_capable = false, 444 446 .align = 1 << 12, 445 447 .bar[BAR_0] = { .only_64bit = true, }, 446 - .bar[BAR_1] = { .type = BAR_RESERVED, }, 447 448 .bar[BAR_2] = { .only_64bit = true, }, 448 - .bar[BAR_3] = { .type = BAR_RESERVED, }, 449 449 .bar[BAR_4] = { .only_64bit = true, }, 450 - .bar[BAR_5] = { .type = BAR_RESERVED, }, 451 450 }, 452 451 }; 453 452
-3
drivers/pci/controller/pcie-rcar-ep.c
··· 440 440 /* use 64-bit BARs so mark BAR[1,3,5] as reserved */ 441 441 .bar[BAR_0] = { .type = BAR_FIXED, .fixed_size = 128, 442 442 .only_64bit = true, }, 443 - .bar[BAR_1] = { .type = BAR_RESERVED, }, 444 443 .bar[BAR_2] = { .type = BAR_FIXED, .fixed_size = 256, 445 444 .only_64bit = true, }, 446 - .bar[BAR_3] = { .type = BAR_RESERVED, }, 447 445 .bar[BAR_4] = { .type = BAR_FIXED, .fixed_size = 256, 448 446 .only_64bit = true, }, 449 - .bar[BAR_5] = { .type = BAR_RESERVED, }, 450 447 }; 451 448 452 449 static const struct pci_epc_features*
+1 -2
include/linux/pci-epc.h
··· 206 206 * @fixed_size: the fixed size, only applicable if type is BAR_FIXED_MASK. 207 207 * @only_64bit: if true, an EPF driver is not allowed to choose if this BAR 208 208 * should be configured as 32-bit or 64-bit, the EPF driver must 209 - * configure this BAR as 64-bit. Additionally, the BAR succeeding 210 - * this BAR must be set to type BAR_RESERVED. 209 + * configure this BAR as 64-bit. 211 210 * 212 211 * only_64bit should not be set on a BAR of type BAR_RESERVED. 213 212 * (If BARx is a 64-bit BAR that an EPF driver is not allowed to