[PATCH v2 0/2] PCI: endpoint: Skip upper halves of 64-bit BARs during search
From: Manikanta Maddireddy
Date: Mon Nov 02 2026 - 06:27:08 EST
pci_epc_get_next_free_bar() can return the upper half of a reserved or
disabled 64-bit BAR when the search passes that BAR. On Tegra, this can
cause the EPF test driver to attempt to program BAR3 and BAR5 even though
they are the upper halves of reserved BAR2 and BAR4.
Patch 1 checks the preceding descriptor for every candidate so that upper
halves are skipped throughout the search. Patch 2 clarifies that only_64bit
also describes the hardware width of a BAR_RESERVED and that the following
BAR register cannot be used independently. The existing wording for BAR
configuration by EPF drivers is retained.
Changes in v2:
- Rebase onto the current PCI main-based patch stack.
- Add a Fixes tag referencing 27ce1d8ecb9b ("PCI: endpoint: Allow only_64bit
on BAR_RESERVED") to patch 1. The code change is unchanged from v1.
- Add patch 2 to clarify only_64bit for BAR_RESERVED, following Niklas
Cassel's review.
- Add a cover letter now that the series contains two patches.
v1: https://lore.kernel.org/linux-pci/20261021080644.1346549-1-mmaddireddy@xxxxxxxxxx/
Manikanta Maddireddy (2):
PCI: endpoint: Skip upper halves of 64-bit BARs during search
PCI: endpoint: Clarify only_64bit for reserved BARs
drivers/pci/endpoint/pci-epc-core.c | 8 ++++----
include/linux/pci-epc.h | 5 +++++
2 files changed, 9 insertions(+), 4 deletions(-)
base-commit: e04b12478ada488e59c54bf17dee4e0f5843e131
--
2.34.1