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: Rename 'epf_bar::aligned_size' to 'epf_bar:mem_size'

Rename the member 'epf_bar::aligned_size' to 'epf_bar::mem_size' to better
reflect its purpose. 'aligned_size' was misleading, as it actually
represents the backing memory size allocated for the BAR rather than the
aligned size.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20251015-vntb_msi_doorbell-v6-1-9230298b1910@nxp.com

authored by

Frank Li and committed by
Manivannan Sadhasivam
48376884 25423cda

+9 -9
+6 -6
drivers/pci/endpoint/pci-epf-core.c
··· 236 236 } 237 237 238 238 dev = epc->dev.parent; 239 - dma_free_coherent(dev, epf_bar[bar].aligned_size, addr, 239 + dma_free_coherent(dev, epf_bar[bar].mem_size, addr, 240 240 epf_bar[bar].phys_addr); 241 241 242 242 epf_bar[bar].phys_addr = 0; 243 243 epf_bar[bar].addr = NULL; 244 244 epf_bar[bar].size = 0; 245 - epf_bar[bar].aligned_size = 0; 245 + epf_bar[bar].mem_size = 0; 246 246 epf_bar[bar].barno = 0; 247 247 epf_bar[bar].flags = 0; 248 248 } ··· 265 265 enum pci_epc_interface_type type) 266 266 { 267 267 u64 bar_fixed_size = epc_features->bar[bar].fixed_size; 268 - size_t aligned_size, align = epc_features->align; 268 + size_t mem_size, align = epc_features->align; 269 269 struct pci_epf_bar *epf_bar; 270 270 dma_addr_t phys_addr; 271 271 struct pci_epc *epc; ··· 297 297 * it might be different if, for example, the fixed size of a BAR 298 298 * is smaller than align. 299 299 */ 300 - aligned_size = align ? ALIGN(size, align) : size; 300 + mem_size = align ? ALIGN(size, align) : size; 301 301 302 302 if (type == PRIMARY_INTERFACE) { 303 303 epc = epf->epc; ··· 308 308 } 309 309 310 310 dev = epc->dev.parent; 311 - space = dma_alloc_coherent(dev, aligned_size, &phys_addr, GFP_KERNEL); 311 + space = dma_alloc_coherent(dev, mem_size, &phys_addr, GFP_KERNEL); 312 312 if (!space) { 313 313 dev_err(dev, "failed to allocate mem space\n"); 314 314 return NULL; ··· 317 317 epf_bar[bar].phys_addr = phys_addr; 318 318 epf_bar[bar].addr = space; 319 319 epf_bar[bar].size = size; 320 - epf_bar[bar].aligned_size = aligned_size; 320 + epf_bar[bar].mem_size = mem_size; 321 321 epf_bar[bar].barno = bar; 322 322 if (upper_32_bits(size) || epc_features->bar[bar].only_64bit) 323 323 epf_bar[bar].flags |= PCI_BASE_ADDRESS_MEM_TYPE_64;
+3 -3
include/linux/pci-epf.h
··· 115 115 * @phys_addr: physical address that should be mapped to the BAR 116 116 * @addr: virtual address corresponding to the @phys_addr 117 117 * @size: the size of the address space present in BAR 118 - * @aligned_size: the size actually allocated to accommodate the iATU alignment 119 - * requirement 118 + * @mem_size: the size actually allocated to accommodate the iATU alignment 119 + * requirement 120 120 * @barno: BAR number 121 121 * @flags: flags that are set for the BAR 122 122 */ ··· 124 124 dma_addr_t phys_addr; 125 125 void *addr; 126 126 size_t size; 127 - size_t aligned_size; 127 + size_t mem_size; 128 128 enum pci_barno barno; 129 129 int flags; 130 130 };