summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/endpoint/pci-epc-core.c5
-rw-r--r--include/linux/pci-epc.h10
2 files changed, 12 insertions, 3 deletions
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
index e546b3dbb240..6c3c58185fc5 100644
--- a/drivers/pci/endpoint/pci-epc-core.c
+++ b/drivers/pci/endpoint/pci-epc-core.c
@@ -103,8 +103,9 @@ enum pci_barno pci_epc_get_next_free_bar(const struct pci_epc_features
bar++;
for (i = bar; i < PCI_STD_NUM_BARS; i++) {
- /* If the BAR is not reserved, return it. */
- if (epc_features->bar[i].type != BAR_RESERVED)
+ /* If the BAR is not reserved or disabled, return it. */
+ if (epc_features->bar[i].type != BAR_RESERVED &&
+ epc_features->bar[i].type != BAR_DISABLED)
return i;
}
diff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h
index ebcdf70aa9b9..334c2b7578d0 100644
--- a/include/linux/pci-epc.h
+++ b/include/linux/pci-epc.h
@@ -191,13 +191,21 @@ struct pci_epc {
* @BAR_RESIZABLE: The BAR implements the PCI-SIG Resizable BAR Capability.
* NOTE: An EPC driver can currently only set a single supported
* size.
- * @BAR_RESERVED: The BAR should not be touched by an EPF driver.
+ * @BAR_RESERVED: Used for HW-backed BARs (e.g. MSI-X table, DMA regs). The BAR
+ * should not be disabled by an EPC driver. The BAR should not be
+ * reprogrammed by an EPF driver. An EPF driver is allowed to
+ * disable the BAR if absolutely necessary. (However, right now
+ * there is no EPC operation to disable a BAR that has not been
+ * programmed using pci_epc_set_bar().)
+ * @BAR_DISABLED: The BAR should be disabled by an EPC driver. The BAR will be
+ * unavailable to an EPF driver.
*/
enum pci_epc_bar_type {
BAR_PROGRAMMABLE = 0,
BAR_FIXED,
BAR_RESIZABLE,
BAR_RESERVED,
+ BAR_DISABLED,
};
/**