PCI: endpoint: Make *_get_first_free_bar() take into account 64 bit BAR
authorKishon Vijay Abraham I <kishon@ti.com>
Mon, 1 Feb 2021 19:57:54 +0000 (01:27 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 23 Feb 2021 20:10:17 +0000 (14:10 -0600)
commit959a48d0eac0321948c9f3d1707ba22c100e92d5
tree3d9cf82fc7bdb42f2a39f76d2f2d5b252944927e
parent13bccf873808ac9516089760efce7ea18b7484a9
PCI: endpoint: Make *_get_first_free_bar() take into account 64 bit BAR

pci_epc_get_first_free_bar() uses only "reserved_bar" member in
epc_features to get the first unreserved BAR. However if the reserved BAR
is also a 64-bit BAR, then the next BAR shouldn't be returned (since 64-bit
BAR uses two BARs).

Make pci_epc_get_first_free_bar() take into account 64 bit BAR while
returning the first free unreserved BAR.

Link: https://lore.kernel.org/r/20210201195809.7342-3-kishon@ti.com
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/endpoint/pci-epc-core.c