linux/kernel/dma
Petr Tesarik aabd12609f swiotlb: always set the number of areas before allocating the pool
The number of areas defaults to the number of possible CPUs. However, the
total number of slots may have to be increased after adjusting the number
of areas. Consequently, the number of areas must be determined before
allocating the memory pool. This is even explained with a comment in
swiotlb_init_remap(), but swiotlb_init_late() adjusts the number of areas
after slots are already allocated. The areas may end up being smaller than
IO_TLB_SEGSIZE, which breaks per-area locking.

While fixing swiotlb_init_late(), move all relevant comments before the
definition of swiotlb_adjust_nareas() and convert them to kernel-doc.

Fixes: 20347fca71 ("swiotlb: split up the global swiotlb lock")
Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2023-06-29 07:10:00 +02:00
..
coherent.c dma-mapping: Add dma_release_coherent_memory to DMA API 2022-06-24 09:30:54 -06:00
contiguous.c cma: factor out minimum alignment requirement 2022-03-22 15:57:05 -07:00
debug.c dma-debug: Use %pa to format phys_addr_t 2023-03-30 08:51:52 +09:00
debug.h
direct.c dma-direct: cleanup parameters to dma_direct_optimal_gfp_mask 2023-03-28 10:34:05 +09:00
direct.h dma-direct: support PCI P2PDMA pages in dma-direct map_sg 2022-07-26 07:27:47 -04:00
dummy.c
Kconfig dma-mapping: fix a Kconfig typo 2023-06-07 15:06:09 +02:00
Makefile dma-mapping: remove CONFIG_DMA_REMAP 2022-03-03 14:00:57 +03:00
map_benchmark.c dma-mapping: benchmark: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:51 -07:00
mapping.c dma-mapping: provide CONFIG_ARCH_DMA_DEFAULT_COHERENT 2023-04-07 07:38:25 +02:00
ops_helpers.c
pool.c mm, treewide: redefine MAX_ORDER sanely 2023-04-05 19:42:46 -07:00
remap.c dma-remap: use kvmalloc_array/kvfree for larger dma memory remap 2023-06-07 15:06:28 +02:00
swiotlb.c swiotlb: always set the number of areas before allocating the pool 2023-06-29 07:10:00 +02:00