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: Introduce pci_epc_bar_type BAR_DISABLED

Add a pci_epc_bar_type BAR_DISABLED to more clearly differentiate from
BAR_RESERVED.

This BAR type will only be used to describe a BAR that the EPC driver
should disable, and will thus never be available to an EPF driver.
(Unlike BAR_RESERVED, which will never be disabled by default by an EPC
driver.)

Co-developed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Koichiro Den <den@valinux.co.jp>
Tested-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Link: https://patch.msgid.link/20260312130229.2282001-17-cassel@kernel.org

authored by

Niklas Cassel and committed by
Manivannan Sadhasivam
33642e9e 489d3abb

+12 -3
+3 -2
drivers/pci/endpoint/pci-epc-core.c
··· 103 103 bar++; 104 104 105 105 for (i = bar; i < PCI_STD_NUM_BARS; i++) { 106 - /* If the BAR is not reserved, return it. */ 107 - if (epc_features->bar[i].type != BAR_RESERVED) 106 + /* If the BAR is not reserved or disabled, return it. */ 107 + if (epc_features->bar[i].type != BAR_RESERVED && 108 + epc_features->bar[i].type != BAR_DISABLED) 108 109 return i; 109 110 } 110 111
+9 -1
include/linux/pci-epc.h
··· 191 191 * @BAR_RESIZABLE: The BAR implements the PCI-SIG Resizable BAR Capability. 192 192 * NOTE: An EPC driver can currently only set a single supported 193 193 * size. 194 - * @BAR_RESERVED: The BAR should not be touched by an EPF driver. 194 + * @BAR_RESERVED: Used for HW-backed BARs (e.g. MSI-X table, DMA regs). The BAR 195 + * should not be disabled by an EPC driver. The BAR should not be 196 + * reprogrammed by an EPF driver. An EPF driver is allowed to 197 + * disable the BAR if absolutely necessary. (However, right now 198 + * there is no EPC operation to disable a BAR that has not been 199 + * programmed using pci_epc_set_bar().) 200 + * @BAR_DISABLED: The BAR should be disabled by an EPC driver. The BAR will be 201 + * unavailable to an EPF driver. 195 202 */ 196 203 enum pci_epc_bar_type { 197 204 BAR_PROGRAMMABLE = 0, 198 205 BAR_FIXED, 199 206 BAR_RESIZABLE, 200 207 BAR_RESERVED, 208 + BAR_DISABLED, 201 209 }; 202 210 203 211 /**