From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Igor Pecovnik <igor.pecovnik@gmail.com>
Date: Mon, 21 Aug 2017 08:54:53 +0200
Subject: [ARCHEOLOGY] Increasing DMA block memory allocation to 2048k on all
 relevant kernels.

> X-Git-Archeology: > recovered message: > https://forum.armbian.com/index.php?/topic/4811-uas-mainline-kernel-coherent-pool-memory-size
> X-Git-Archeology: - Revision 908bb199ec2defd77f7f05d2016980abf100d627: https://github.com/armbian/build/commit/908bb199ec2defd77f7f05d2016980abf100d627
> X-Git-Archeology:   Date: Mon, 21 Aug 2017 08:54:53 +0200
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: Increasing DMA block memory allocation to 2048k on all relevant kernels.
> X-Git-Archeology:
> X-Git-Archeology: - Revision a3cf7b74858e1f862db8ca238bd44f6406be6662: https://github.com/armbian/build/commit/a3cf7b74858e1f862db8ca238bd44f6406be6662
> X-Git-Archeology:   Date: Mon, 21 Aug 2017 17:52:29 +0200
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: Revert "Increasing DMA block memory allocation to 2048k on all relevant kernels."
> X-Git-Archeology:
> X-Git-Archeology: - Revision 2be21aad5dc965b3bc67e136a1e1170119d60f74: https://github.com/armbian/build/commit/2be21aad5dc965b3bc67e136a1e1170119d60f74
> X-Git-Archeology:   Date: Mon, 21 Aug 2017 17:52:48 +0200
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: Increasing DMA block memory allocation to 2048k on all relevant kernels. https://forum.armbian.com/index.php?/topic/4811-uas-mainline-kernel-coherent-pool-memory-size
> X-Git-Archeology:
> X-Git-Archeology: - Revision b3d2bd4864d89ce032344051e6ced2ba9371084b: https://github.com/armbian/build/commit/b3d2bd4864d89ce032344051e6ced2ba9371084b
> X-Git-Archeology:   Date: Wed, 30 Aug 2017 05:42:08 +0000
> X-Git-Archeology:   From: Tonymac32 <tonymckahan@gmail.com>
> X-Git-Archeology:   Subject: Meson64 Dev increase DMA block memory allocation
> X-Git-Archeology:
> X-Git-Archeology: - Revision 2c59bb9934b749b5df74d4134cd393dc24fd5160: https://github.com/armbian/build/commit/2c59bb9934b749b5df74d4134cd393dc24fd5160
> X-Git-Archeology:   Date: Mon, 18 Sep 2017 12:06:30 +0200
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: Lepotato. Added NEXT, added patches from C2 NEXT, au, config update, removed deprecated patches, ...
> X-Git-Archeology:
> X-Git-Archeology: - Revision 13e94e58f04be27db51d18b7dac1d15a1864b79e: https://github.com/armbian/build/commit/13e94e58f04be27db51d18b7dac1d15a1864b79e
> X-Git-Archeology:   Date: Fri, 27 Oct 2017 16:14:21 +0300
> X-Git-Archeology:   From: zador-blood-stained <zador-blood-stained@users.noreply.github.com>
> X-Git-Archeology:   Subject: Remove random executable bits from patch files
> X-Git-Archeology:
> X-Git-Archeology: - Revision 2c08ec8f5a210de35f9482f482ac01ea15381792: https://github.com/armbian/build/commit/2c08ec8f5a210de35f9482f482ac01ea15381792
> X-Git-Archeology:   Date: Thu, 24 May 2018 13:32:29 +0200
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: Merge sunxi family into stable
> X-Git-Archeology:
> X-Git-Archeology: - Revision 7d2f3af08f23049c91c88eec5062613bbfbc85d4: https://github.com/armbian/build/commit/7d2f3af08f23049c91c88eec5062613bbfbc85d4
> X-Git-Archeology:   Date: Thu, 24 May 2018 15:44:15 +0200
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: Merging Rockchip family
> X-Git-Archeology:
> X-Git-Archeology: - Revision 99a34c7be1e342247a981f99c7930ee73c144f3e: https://github.com/armbian/build/commit/99a34c7be1e342247a981f99c7930ee73c144f3e
> X-Git-Archeology:   Date: Tue, 26 Jun 2018 12:47:49 +0000
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: Move Odroid C2 from 4.14.y to 4.16.y, added patch for ethernet, DEV to master, both tested ... not perfect but in a better condition.
> X-Git-Archeology:
> X-Git-Archeology: - Revision fcb85f17675990514d8fadc905e6ccc3bded7138: https://github.com/armbian/build/commit/fcb85f17675990514d8fadc905e6ccc3bded7138
> X-Git-Archeology:   Date: Thu, 28 Jun 2018 08:27:08 +0000
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: Major Amlogic RFC and cleanup
> X-Git-Archeology:
> X-Git-Archeology: - Revision c57ebd663cf1b15ad193d4a761f9c044ba3b2acf: https://github.com/armbian/build/commit/c57ebd663cf1b15ad193d4a761f9c044ba3b2acf
> X-Git-Archeology:   Date: Tue, 17 Jul 2018 16:11:07 +0200
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: - attach Odroid XU4 4.14.y back to Hardkernel kernel branch
> X-Git-Archeology:
> X-Git-Archeology: - Revision a26ccdee627f1fa27b3285e3840434cddb5aae62: https://github.com/armbian/build/commit/a26ccdee627f1fa27b3285e3840434cddb5aae62
> X-Git-Archeology:   Date: Wed, 07 Nov 2018 11:11:51 +0100
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: [odroid xu4] Drop kernel 3.10.y, default -> offical 4.14.y, next = vanilla 4.19.y http://ix.io/1rcZ & dev = n/a
> X-Git-Archeology:
> X-Git-Archeology: - Revision a156fddf8f5bb5a6ac28ffc528ba0ec28ff9df81: https://github.com/armbian/build/commit/a156fddf8f5bb5a6ac28ffc528ba0ec28ff9df81
> X-Git-Archeology:   Date: Fri, 18 Jan 2019 20:10:35 +0100
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: [ odroidxu4 ] Reverting NEXT back to stock 4.14.y due to many troubles, DEV = 4.19.y
> X-Git-Archeology:
> X-Git-Archeology: - Revision 79c1c2781915c59bd24576af92b9dbe57da24fac: https://github.com/armbian/build/commit/79c1c2781915c59bd24576af92b9dbe57da24fac
> X-Git-Archeology:   Date: Fri, 17 May 2019 10:46:57 +0200
> X-Git-Archeology:   From: Igor Pecovnik <igor.pecovnik@gmail.com>
> X-Git-Archeology:   Subject: [ odroidxu4 dev ] Move to 5.1.y
> X-Git-Archeology:
> X-Git-Archeology: - Revision 150ac0c2afa147d9e3b036c8ecd8238fe5648cf3: https://github.com/armbian/build/commit/150ac0c2afa147d9e3b036c8ecd8238fe5648cf3
> X-Git-Archeology:   Date: Tue, 19 Nov 2019 23:25:39 +0100
> X-Git-Archeology:   From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
> X-Git-Archeology:   Subject: Remove K<4, change branches, new features (#1586)
> X-Git-Archeology:
> X-Git-Archeology: - Revision 4d4c3f58ffc1cbfbb060cbabc9eb414036a2fda5: https://github.com/armbian/build/commit/4d4c3f58ffc1cbfbb060cbabc9eb414036a2fda5
> X-Git-Archeology:   Date: Wed, 02 Sep 2020 23:22:09 +0200
> X-Git-Archeology:   From: Piotr Szczepanik <piter75@gmail.com>
> X-Git-Archeology:   Subject: Switched rockchip64 curent to kernel 5.8.y (#2175)
> X-Git-Archeology:
> X-Git-Archeology: - Revision 0cdffb29b07305209efb12cf3b5ac6032d3a1153: https://github.com/armbian/build/commit/0cdffb29b07305209efb12cf3b5ac6032d3a1153
> X-Git-Archeology:   Date: Wed, 24 Mar 2021 19:01:53 +0100
> X-Git-Archeology:   From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
> X-Git-Archeology:   Subject: Renaming DEV branch to EDGE (#2704)
> X-Git-Archeology:
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: https://github.com/armbian/build/commit/92f1a22d76b987afa7ba555d5b509adc51d689e7
> X-Git-Archeology:   Date: Fri, 16 Dec 2022 13:38:13 +0100
> X-Git-Archeology:   From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
> X-Git-Archeology:   Subject: Re-add rockchip64 6.0 patches (#4575)
> X-Git-Archeology:
> X-Git-Archeology: - Revision e4d413b9166e3633b40fb23382fb1045b9d0e315: https://github.com/armbian/build/commit/e4d413b9166e3633b40fb23382fb1045b9d0e315
> X-Git-Archeology:   Date: Tue, 26 Mar 2024 13:46:35 +0100
> X-Git-Archeology:   From: Paolo Sabatino <paolo.sabatino@gmail.com>
> X-Git-Archeology:   Subject: rockchip64: bump edge kernel to 6.8
> X-Git-Archeology:
> X-Git-Archeology: - Revision 69ca2492628b2aae217c33fde921b3840851eb14: https://github.com/armbian/build/commit/69ca2492628b2aae217c33fde921b3840851eb14
> X-Git-Archeology:   Date: Wed, 05 Jun 2024 22:18:24 +0200
> X-Git-Archeology:   From: Paolo Sabatino <paolo.sabatino@gmail.com>
> X-Git-Archeology:   Subject: rockchip64: bump edge kernel to 6.9
> X-Git-Archeology:
> X-Git-Archeology: - Revision 4ae0a958146810117050d0dbd359b99691a0fa0c: https://github.com/armbian/build/commit/4ae0a958146810117050d0dbd359b99691a0fa0c
> X-Git-Archeology:   Date: Mon, 22 Jul 2024 19:17:52 +0200
> X-Git-Archeology:   From: Paolo Sabatino <paolo.sabatino@gmail.com>
> X-Git-Archeology:   Subject: rockchip64: bump edge kernel to 6.10
> X-Git-Archeology:
---
 kernel/dma/pool.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
index 111111111111..222222222222 100644
--- a/kernel/dma/pool.c
+++ b/kernel/dma/pool.c
@@ -189,13 +189,11 @@ static int __init dma_atomic_pool_init(void)
 	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_PAGE_ORDER.
+	 * 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);
 
-- 
Armbian

