mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
Merge tag 'dma-mapping-6.6-2023-08-29' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-maping updates from Christoph Hellwig: - allow dynamic sizing of the swiotlb buffer, to cater for secure virtualization workloads that require all I/O to be bounce buffered (Petr Tesarik) - move a declaration to a header (Arnd Bergmann) - check for memory region overlap in dma-contiguous (Binglei Wang) - remove the somewhat dangerous runtime swiotlb-xen enablement and unexport is_swiotlb_active (Christoph Hellwig, Juergen Gross) - per-node CMA improvements (Yajun Deng) * tag 'dma-mapping-6.6-2023-08-29' of git://git.infradead.org/users/hch/dma-mapping: swiotlb: optimize get_max_slots() swiotlb: move slot allocation explanation comment where it belongs swiotlb: search the software IO TLB only if the device makes use of it swiotlb: allocate a new memory pool when existing pools are full swiotlb: determine potential physical address limit swiotlb: if swiotlb is full, fall back to a transient memory pool swiotlb: add a flag whether SWIOTLB is allowed to grow swiotlb: separate memory pool data from other allocator data swiotlb: add documentation and rename swiotlb_do_find_slots() swiotlb: make io_tlb_default_mem local to swiotlb.c swiotlb: bail out of swiotlb_init_late() if swiotlb is already allocated dma-contiguous: check for memory region overlap dma-contiguous: support numa CMA for specified node dma-contiguous: support per-numa CMA for all architectures dma-mapping: move arch_dma_set_mask() declaration to header swiotlb: unexport is_swiotlb_active x86: always initialize xen-swiotlb when xen-pcifront is enabling xen/pci: add flag for PCI passthrough being possible
This commit is contained in:
10
mm/cma.c
10
mm/cma.c
@@ -267,6 +267,9 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
|
||||
if (alignment && !is_power_of_2(alignment))
|
||||
return -EINVAL;
|
||||
|
||||
if (!IS_ENABLED(CONFIG_NUMA))
|
||||
nid = NUMA_NO_NODE;
|
||||
|
||||
/* Sanitise input arguments. */
|
||||
alignment = max_t(phys_addr_t, alignment, CMA_MIN_ALIGNMENT_BYTES);
|
||||
if (fixed && base & (alignment - 1)) {
|
||||
@@ -372,14 +375,15 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
|
||||
if (ret)
|
||||
goto free_mem;
|
||||
|
||||
pr_info("Reserved %ld MiB at %pa\n", (unsigned long)size / SZ_1M,
|
||||
&base);
|
||||
pr_info("Reserved %ld MiB at %pa on node %d\n", (unsigned long)size / SZ_1M,
|
||||
&base, nid);
|
||||
return 0;
|
||||
|
||||
free_mem:
|
||||
memblock_phys_free(base, size);
|
||||
err:
|
||||
pr_err("Failed to reserve %ld MiB\n", (unsigned long)size / SZ_1M);
|
||||
pr_err("Failed to reserve %ld MiB on node %d\n", (unsigned long)size / SZ_1M,
|
||||
nid);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user