Skip to content

Commit 9266514

Browse files
floatiousMani-Sadhasivam
authored andcommitted
PCI: endpoint: Drop only_64bit on reserved BARs
The definition of a reserved BAR is that EPF drivers should not touch them. The definition of only_64bit is that the EPF driver must configure this BAR as 64-bit. (An EPF driver is not allowed to choose if this BAR should be configured as 32-bit or 64-bit.) Thus, it does not make sense to put only_64bit of a BAR that EPF drivers are not allow to touch. Drop the only_64bit property from hardware descriptions that are of type reserved BAR. Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Kishon Vijay Abraham I <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]>
1 parent e01c979 commit 9266514

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ static const struct pci_epc_features ks_pcie_am654_epc_features = {
924924
.linkup_notifier = false,
925925
.msi_capable = true,
926926
.msix_capable = true,
927-
.bar[BAR_0] = { .type = BAR_RESERVED, .only_64bit = true, },
927+
.bar[BAR_0] = { .type = BAR_RESERVED, },
928928
.bar[BAR_1] = { .type = BAR_RESERVED, },
929929
.bar[BAR_2] = { .type = BAR_FIXED, .fixed_size = SZ_1M, },
930930
.bar[BAR_3] = { .type = BAR_FIXED, .fixed_size = SZ_64K, },

drivers/pci/controller/dwc/pcie-uniphier-ep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static const struct uniphier_pcie_ep_soc_data uniphier_pro5_data = {
415415
.bar[BAR_1] = { .type = BAR_RESERVED, },
416416
.bar[BAR_2] = { .only_64bit = true, },
417417
.bar[BAR_3] = { .type = BAR_RESERVED, },
418-
.bar[BAR_4] = { .type = BAR_RESERVED, .only_64bit = true, },
418+
.bar[BAR_4] = { .type = BAR_RESERVED, },
419419
.bar[BAR_5] = { .type = BAR_RESERVED, },
420420
},
421421
};

drivers/pci/endpoint/pci-epc-core.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,6 @@ enum pci_barno pci_epc_get_next_free_bar(const struct pci_epc_features
120120
/* If the BAR is not reserved, return it. */
121121
if (epc_features->bar[i].type != BAR_RESERVED)
122122
return i;
123-
124-
/*
125-
* If the BAR is reserved, and marked as 64-bit only, then the
126-
* succeeding BAR is also reserved.
127-
*/
128-
if (epc_features->bar[i].only_64bit)
129-
i++;
130123
}
131124

132125
return NO_BAR;

include/linux/pci-epc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ enum pci_epc_bar_type {
164164
* should be configured as 32-bit or 64-bit, the EPF driver must
165165
* configure this BAR as 64-bit. Additionally, the BAR succeeding
166166
* this BAR must be set to type BAR_RESERVED.
167+
*
168+
* only_64bit should not be set on a BAR of type BAR_RESERVED.
169+
* (If BARx is a 64-bit BAR that an EPF driver is not allowed to
170+
* touch, then both BARx and BARx+1 must be set to type
171+
* BAR_RESERVED.)
167172
*/
168173
struct pci_epc_bar_desc {
169174
enum pci_epc_bar_type type;

0 commit comments

Comments
 (0)