Commit 1b504402 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'dma-mapping-5.8-3' of git://git.infradead.org/users/hch/dma-mapping

Pull dma-mapping fixes from Christoph Hellwig:
 "Fixes for the SEV atomic pool (Geert Uytterhoeven and David Rientjes)"

* tag 'dma-mapping-5.8-3' of git://git.infradead.org/users/hch/dma-mapping:
  dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL
  dma-pool: fix too large DMA pools on medium memory size systems
parents 69119673 dbed452a
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -73,18 +73,18 @@ config SWIOTLB
config DMA_NONCOHERENT_MMAP
	bool

config DMA_COHERENT_POOL
	bool

config DMA_REMAP
	bool
	depends on MMU
	select GENERIC_ALLOCATOR
	select DMA_NONCOHERENT_MMAP
	bool

config DMA_COHERENT_POOL
	bool
	select DMA_REMAP

config DMA_DIRECT_REMAP
	bool
	select DMA_REMAP
	select DMA_COHERENT_POOL

config DMA_CMA
+3 −4
Original line number Diff line number Diff line
@@ -175,10 +175,9 @@ static int __init dma_atomic_pool_init(void)
	 * sizes to 128KB per 1GB of memory, min 128KB, max MAX_ORDER-1.
	 */
	if (!atomic_pool_size) {
		atomic_pool_size = max(totalram_pages() >> PAGE_SHIFT, 1UL) *
					SZ_128K;
		atomic_pool_size = min_t(size_t, atomic_pool_size,
					 1 << (PAGE_SHIFT + MAX_ORDER-1));
		unsigned long pages = totalram_pages() / (SZ_1G / SZ_128K);
		pages = min_t(unsigned long, pages, MAX_ORDER_NR_PAGES);
		atomic_pool_size = max_t(size_t, pages << PAGE_SHIFT, SZ_128K);
	}
	INIT_WORK(&atomic_pool_work, atomic_pool_work_fn);