diff mbox series

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

Message ID 20200704130829.34297-1-maxime@cerno.tech (mailing list archive)
State Mainlined
Commit 92025b90f18d45e26b7f17d68756b1abd771b9d3
Headers show
Series ARM: dts sunxi: Relax a bit the CMA pool allocation range | expand

Commit Message

Maxime Ripard July 4, 2020, 1:08 p.m. UTC
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 <paul.kocialkowski@bootlin.com>
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")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 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(-)

Comments

Chen-Yu Tsai July 6, 2020, 3:18 a.m. UTC | #1
On Sat, Jul 4, 2020 at 9:08 PM Maxime Ripard <maxime@cerno.tech> wrote:
>
> 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 <paul.kocialkowski@bootlin.com>
> 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")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

Acked-by: Chen-Yu Tsai <wens@csie.org>
Maxime Ripard July 6, 2020, 1:11 p.m. UTC | #2
On Mon, Jul 06, 2020 at 11:18:51AM +0800, Chen-Yu Tsai wrote:
> On Sat, Jul 4, 2020 at 9:08 PM Maxime Ripard <maxime@cerno.tech> wrote:
> >
> > 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 <paul.kocialkowski@bootlin.com>
> > 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")
> > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> 
> Acked-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!
Maxime
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index bf531efc0610..0f95a6ef8543 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -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;
 		};
diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i.dtsi
index e6b036734a64..c2b4fbf552a3 100644
--- a/arch/arm/boot/dts/sun5i.dtsi
+++ b/arch/arm/boot/dts/sun5i.dtsi
@@ -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;
 		};
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
index ffe1d10a1a84..6d6a37940db2 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -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;
 		};