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.

Merge tag 'dma-mapping-6.17-2025-08-28' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux

Pull dma-mapping fixes from Marek Szyprowski:

- another small fix for arm64 systems with memory encryption (Shanker
Donthineni)

- fix for arm32 systems with non-standard CMA configuration (Oreoluwa
Babatunde)

* tag 'dma-mapping-6.17-2025-08-28' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux:
dma/pool: Ensure DMA_DIRECT_REMAP allocations are decrypted
of: reserved_mem: Restructure call site for dma_contiguous_early_fixup()

+17 -8
+12 -4
drivers/of/of_reserved_mem.c
··· 25 25 #include <linux/memblock.h> 26 26 #include <linux/kmemleak.h> 27 27 #include <linux/cma.h> 28 + #include <linux/dma-map-ops.h> 28 29 29 30 #include "of_private.h" 30 31 ··· 176 175 base = dt_mem_next_cell(dt_root_addr_cells, &prop); 177 176 size = dt_mem_next_cell(dt_root_size_cells, &prop); 178 177 179 - if (size && 180 - early_init_dt_reserve_memory(base, size, nomap) == 0) 178 + if (size && early_init_dt_reserve_memory(base, size, nomap) == 0) { 179 + /* Architecture specific contiguous memory fixup. */ 180 + if (of_flat_dt_is_compatible(node, "shared-dma-pool") && 181 + of_get_flat_dt_prop(node, "reusable", NULL)) 182 + dma_contiguous_early_fixup(base, size); 181 183 pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %lu MiB\n", 182 184 uname, &base, (unsigned long)(size / SZ_1M)); 183 - else 185 + } else { 184 186 pr_err("Reserved memory: failed to reserve memory for node '%s': base %pa, size %lu MiB\n", 185 187 uname, &base, (unsigned long)(size / SZ_1M)); 188 + } 186 189 187 190 len -= t_len; 188 191 } ··· 477 472 uname, (unsigned long)(size / SZ_1M)); 478 473 return -ENOMEM; 479 474 } 480 - 475 + /* Architecture specific contiguous memory fixup. */ 476 + if (of_flat_dt_is_compatible(node, "shared-dma-pool") && 477 + of_get_flat_dt_prop(node, "reusable", NULL)) 478 + dma_contiguous_early_fixup(base, size); 481 479 /* Save region in the reserved_mem array */ 482 480 fdt_reserved_mem_save_node(node, uname, base, size); 483 481 return 0;
+3
include/linux/dma-map-ops.h
··· 153 153 { 154 154 __free_pages(page, get_order(size)); 155 155 } 156 + static inline void dma_contiguous_early_fixup(phys_addr_t base, unsigned long size) 157 + { 158 + } 156 159 #endif /* CONFIG_DMA_CMA*/ 157 160 158 161 #ifdef CONFIG_DMA_DECLARE_COHERENT
-2
kernel/dma/contiguous.c
··· 483 483 pr_err("Reserved memory: unable to setup CMA region\n"); 484 484 return err; 485 485 } 486 - /* Architecture specific contiguous memory fixup. */ 487 - dma_contiguous_early_fixup(rmem->base, rmem->size); 488 486 489 487 if (default_cma) 490 488 dma_contiguous_default_area = cma;
+2 -2
kernel/dma/pool.c
··· 102 102 103 103 #ifdef CONFIG_DMA_DIRECT_REMAP 104 104 addr = dma_common_contiguous_remap(page, pool_size, 105 - pgprot_dmacoherent(PAGE_KERNEL), 106 - __builtin_return_address(0)); 105 + pgprot_decrypted(pgprot_dmacoherent(PAGE_KERNEL)), 106 + __builtin_return_address(0)); 107 107 if (!addr) 108 108 goto free_page; 109 109 #else