Skip to contentSkip to conversation

ARM: dts sunxi: Relax a bit the CMA pool allocation range

PATCH In review Maxime Ripard 2 participants 3 messages Jul 4, 2020 – Jul 6, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts sunxi: Relax a bit the CMA pool allocation range

The hardware codec on the A10, A10s, A13 and A20 needs buffer in the first 256MB of RAM. This was solved by setting the CMA pool at a fixed address in that range.

However, in recent kernels there's something else that comes in and reserve some range that end up conflicting with our default pool requirement, and thus makes its reservation fail.

The video codec will then use buffers from the usual default pool, outside of the range it can access, and will fail to decode anything.

Since we're only concerned about that 256MB, we can however relax the allocation to just specify the range that's allowed, and not try to enforce a specific address.

Cc Paul Kocialkowski <[email protected]>
Fixes 5949bc5602cc ("ARM: dts: sun4i-a10: Add Video Engine and reserved memory nodes")
Fixes 960432010156 ("ARM: dts: sun5i: Add Video Engine and reserved memory nodes")
Fixes c2a641a74850 ("ARM: dts: sun7i-a20: Add Video Engine and reserved memory nodes")
---
 arch/arm/boot/dts/sun4i-a10.dtsi | 2 +-
 arch/arm/boot/dts/sun5i.dtsi     | 2 +-
 arch/arm/boot/dts/sun7i-a20.dtsi | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/sun4i-a10.dtsi +1 -1
index bf531efc0610..0f95a6ef8543 100644
@@ -198,7 +198,7 @@ reserved-memory {
 		default-pool {
 			compatible = "shared-dma-pool";
 			size = <0x6000000>;
-			alloc-ranges = <0x4a000000 0x6000000>;
+			alloc-ranges = <0x40000000 0x10000000>;
 			reusable;
 			linux,cma-default;
 		};
arch/arm/boot/dts/sun5i.dtsi +1 -1
index e6b036734a64..c2b4fbf552a3 100644
@@ -117,7 +117,7 @@ reserved-memory {
 		default-pool {
 			compatible = "shared-dma-pool";
 			size = <0x6000000>;
-			alloc-ranges = <0x4a000000 0x6000000>;
+			alloc-ranges = <0x40000000 0x10000000>;
 			reusable;
 			linux,cma-default;
 		};
arch/arm/boot/dts/sun7i-a20.dtsi +1 -1
index ffe1d10a1a84..6d6a37940db2 100644
@@ -181,7 +181,7 @@ reserved-memory {
 		default-pool {
 			compatible = "shared-dma-pool";
 			size = <0x6000000>;
-			alloc-ranges = <0x4a000000 0x6000000>;
+			alloc-ranges = <0x40000000 0x10000000>;
 			reusable;
 			linux,cma-default;
 		};
Signature · 7 lines
2.26.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Maxime Ripard

The hardware codec on the A10, A10s, A13 and A20 needs buffer in the first 256MB of RAM. This was solved by setting the CMA pool at a fixed address in that range.

However, in recent kernels there's something else that comes in and reserve some range that end up conflicting with our default pool requirement, and thus makes its reservation fail.

The video codec will then use buffers from the usual default pool, outside of the range it can access, and will fail to decode anything.

Since we're only concerned about that 256MB, we can however relax the allocation to just specify the range that's allowed, and not try to enforce a specific address.

Quoted 5 lines
Cc Paul Kocialkowski <[email protected]>
Fixes 5949bc5602cc ("ARM: dts: sun4i-a10: Add Video Engine and reserved memory nodes")
Fixes 960432010156 ("ARM: dts: sun5i: Add Video Engine and reserved memory nodes")
Fixes c2a641a74850 ("ARM: dts: sun7i-a20: Add Video Engine and reserved memory nodes")

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author Applied
#2 lore raw
Quoted 17 lines · Chen-Yu Tsai
Quoted 16 lines · Maxime Ripard

The hardware codec on the A10, A10s, A13 and A20 needs buffer in the first 256MB of RAM. This was solved by setting the CMA pool at a fixed address in that range.

However, in recent kernels there's something else that comes in and reserve some range that end up conflicting with our default pool requirement, and thus makes its reservation fail.

The video codec will then use buffers from the usual default pool, outside of the range it can access, and will fail to decode anything.

Since we're only concerned about that 256MB, we can however relax the allocation to just specify the range that's allowed, and not try to enforce a specific address.

Quoted 7 lines
Quoted 5 lines
Cc Paul Kocialkowski <[email protected]>
Fixes 5949bc5602cc ("ARM: dts: sun4i-a10: Add Video Engine and reserved memory nodes")
Fixes 960432010156 ("ARM: dts: sun5i: Add Video Engine and reserved memory nodes")
Fixes c2a641a74850 ("ARM: dts: sun7i-a20: Add Video Engine and reserved memory nodes")

Applied, thanks!
Maxime

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel