Adjusted default coherent_pool to 2MiB for rockchip64-dev in 5.8.y

This commit is contained in:
Piotr Szczepanik 2020-08-14 16:24:15 +02:00
parent 7b47fc023a
commit 82d8ff8780

View file

@ -1,13 +1,21 @@
diff --git a/kernel/dma/remap.c b/kernel/dma/remap.c
index 7a723194e..1a05e9e5b 100644
--- a/kernel/dma/remap.c
+++ b/kernel/dma/remap.c
@@ -95,7 +95,7 @@ void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags)
#ifdef CONFIG_DMA_DIRECT_REMAP
static struct gen_pool *atomic_pool __ro_after_init;
diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
index 6bc74a2d5..e3827da51 100644
--- a/kernel/dma/pool.c
+++ b/kernel/dma/pool.c
@@ -164,13 +164,11 @@ static int __init dma_atomic_pool_init(void)
int ret = 0;
-#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K
+#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_2M
static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE;
/*
- * If coherent_pool was not used on the command line, default the pool
- * sizes to 128KB per 1GB of memory, min 128KB, max MAX_ORDER-1.
+ * Always use 2MiB as default pool size.
+ * See: https://forum.armbian.com/topic/4811-uas-mainline-kernel-coherent-pool-memory-size/
*/
if (!atomic_pool_size) {
- 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);
+ atomic_pool_size = SZ_2M;
}
INIT_WORK(&atomic_pool_work, atomic_pool_work_fn);
static int __init early_coherent_pool(char *p)