failed to allocate memory for node 'linux,cma'

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

failed to allocate memory for node 'linux,cma'

Jump to solution
3,784 Views
khang_letruong
Senior Contributor III

Dear Community,

I am bringing up an iMX8M Plus based board having 1GB DDR capacity :

 

root@viperimx8mp:~# free                                                                            
               total        used        free      shared  buff/cache   available                    
Mem:          968116      115580      771180       10556       81356      761580                    
Swap:              0           0           0                                 

 

I also adjusted the  memory layout in custom .dtsi as below :

 

+
+#include "imx8mp.dtsi"
+
+/ {
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0x0 0x40000000 0 0x40000000>;
+       };
+
+       resmem: reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               ocram: ocram@900000 {
+                       no-map;
+                       reg = <0 0x900000 0 0x70000>;
+               };
+
+/*
+ *             Memory reserved for optee usage. Please do not use.
+ *             This will be automaticky added to dtb if OP-TEE is installed.
+ *             optee@56000000 {
+ *                     reg = <0 0x56000000 0 0x2000000>;
+ *                     no-map;
+ *             };
+ */
+               /* global autoconfigured region for contiguous allocations */
+               linux,cma {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0 0x3c000000>;
+                       alloc-ranges = <0 0x40000000 0 0x40000000>;
+                       linux,cma-default;
+               };
+
+               dsp_reserved: dsp@92400000 {
+                       reg = <0 0x92400000 0 0x1000000>;
+                       no-map;
+               };
+               dsp_reserved_heap: dsp_reserved_heap {
+                       reg = <0 0x93400000 0 0xef0000>;
+                       no-map;
+               };
+               dsp_vdev0vring0: vdev0vring0@942f0000 {
+                       reg = <0 0x942f0000 0 0x8000>;
+                       no-map;
+               };
+               dsp_vdev0vring1: vdev0vring1@942f8000 {
+                       reg = <0 0x942f8000 0 0x8000>;
+                       no-map;
+               };
+               dsp_vdev0buffer: vdev0buffer@94300000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0 0x94300000 0 0x100000>;
+                       no-map;
+               };
+
+               /* used only by tuning tool, can be removed for normal case */
+               isp0_reserved: isp0@94400000 {
+                       no-map;
+                       reg = <0 0x94400000 0 0x10000000>;
+               };
+       };
+};

 

However, I still have the following error :

 

root@viperimx8mp:~# dmesg | grep cma
[    0.000000] OF: reserved mem: failed to allocate memory for node 'linux,cma'
[    0.000000] cma: Reserved 32 MiB at 0x000000007c000000
[    0.000000] Memory: 932468K/1015808K available (17920K kernel code, 1506K rwdata, 6920K rodata, 2880K init, 553K bss, 50572K reserved, 32768K cma-reserved)

 

 

Could anybody help to configure the memory layout to avoid this problem, please ? I am using BSP LF-5.10.52-2.1.0.

Thanks in advance and best regards,

Khang

 

0 Kudos
Reply
1 Solution
3,753 Views
khang_letruong
Senior Contributor III

I think I found the root cause: allocating 960MB for CMA over 1GB of memory seems not practical.

Regards,
K.

View solution in original post

Tags (1)
0 Kudos
Reply
1 Reply
3,754 Views
khang_letruong
Senior Contributor III

I think I found the root cause: allocating 960MB for CMA over 1GB of memory seems not practical.

Regards,
K.

Tags (1)
0 Kudos
Reply