From e9a10023af0c54ae476f8348624c2793b02b836a Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 12 Aug 2022 11:09:56 +0000 Subject: [PATCH] rockchip: adjust default DMA coherent_pool to 2MiB --- ...ch => 0105-nanopi-r4s-sd-signalling.patch} | 0 ...adjust-default-coherent_pool-to-2MiB.patch | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+) rename target/linux/rockchip/patches-5.19/{105-nanopi-r4s-sd-signalling.patch => 0105-nanopi-r4s-sd-signalling.patch} (100%) create mode 100644 target/linux/rockchip/patches-5.19/0911-kernel-dma-adjust-default-coherent_pool-to-2MiB.patch diff --git a/target/linux/rockchip/patches-5.19/105-nanopi-r4s-sd-signalling.patch b/target/linux/rockchip/patches-5.19/0105-nanopi-r4s-sd-signalling.patch similarity index 100% rename from target/linux/rockchip/patches-5.19/105-nanopi-r4s-sd-signalling.patch rename to target/linux/rockchip/patches-5.19/0105-nanopi-r4s-sd-signalling.patch diff --git a/target/linux/rockchip/patches-5.19/0911-kernel-dma-adjust-default-coherent_pool-to-2MiB.patch b/target/linux/rockchip/patches-5.19/0911-kernel-dma-adjust-default-coherent_pool-to-2MiB.patch new file mode 100644 index 000000000..690c85dbb --- /dev/null +++ b/target/linux/rockchip/patches-5.19/0911-kernel-dma-adjust-default-coherent_pool-to-2MiB.patch @@ -0,0 +1,28 @@ +From 16bdf3e76fec6ddb44f1fcf221139fb39d225031 Mon Sep 17 00:00:00 2001 +From: Igor Pecovnik +Date: Sat, 2 Jan 2021 05:23:55 +0000 +Subject: [PATCH] kernel: dma: adjust default coherent_pool to 2MiB + +--- + kernel/dma/pool.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/kernel/dma/pool.c ++++ b/kernel/dma/pool.c +@@ -189,13 +189,11 @@ static int __init dma_atomic_pool_init(v + int ret = 0; + + /* +- * 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); +