Tool/software:
Hi,
Yocto SDK: 09_01_00
EVM: AM62A SK EVM
We have designed custom me board based on AM62A SK EVM. Only change we did is changed DDR from 4GB to 1GB. After DDR change, We were getting CMA memory pool allocation issue. I am adding kernel log of error below.
Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034] [ 0.000000] Linux version 6.1.46-rt13-gb871cdee8c (oe-user@oe-host) (aarch64-oe-linux-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT_RT Thu Dec 7 23:52:13 UTC 2023 [ 0.000000] Machine model: Texas Instruments AM62A7 SK [ 0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '') [ 0.000000] printk: bootconsole [ns16550a0] enabled [ 0.000000] efi: UEFI not found. [ 0.000000] OF: reserved mem: failed to allocate memory for node 'linux,cma': size 576 MiB [ 0.000000] Reserved memory: created DMA memory pool at 0x0000000099800000, size 1 MiB [ 0.000000] OF: reserved mem: initialized node c7x-dma-memory@99800000, compatible id shared-dma-pool [ 0.000000] Reserved memory: created DMA memory pool at 0x0000000099900000, size 30 MiB [ 0.000000] OF: reserved mem: initialized node c7x-memory@99900000, compatible id shared-dma-pool [ 0.000000] Reserved memory: created DMA memory pool at 0x000000009b800000, size 1 MiB [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@9b800000, compatible id shared-dma-pool [ 0.000000] Reserved memory: created DMA memory pool at 0x000000009b900000, size 15 MiB [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@9b900000, compatible id shared-dma-pool [ 0.000000] Reserved memory: created DMA memory pool at 0x000000009c800000, size 1 MiB [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@9c800000, compatible id shared-dma-pool [ 0.000000] Reserved memory: created DMA memory pool at 0x000000009c900000, size 30 MiB [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@9c900000, compatible id shared-dma-pool [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 32 MiB [ 0.000000] OF: reserved mem: initialized node edgeai-dma-memory@a1000000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: initialized node edgeai_shared-memories, compatible id dma-heap-carveout [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000080000000-0x00000000bfffffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000080000000-0x00000000997fffff] [ 0.000000] node 0: [mem 0x0000000099800000-0x000000009b7fefff] [ 0.000000] node 0: [mem 0x000000009b800000-0x000000009e6fffff] [ 0.000000] node 0: [mem 0x000000009e700000-0x000000009e77ffff] [ 0.000000] node 0: [mem 0x000000009e780000-0x00000000a2ffffff] [ 0.000000] node 0: [mem 0x00000000a3000000-0x00000000bfffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000bfffffff] [ 0.000000] On node 0, zone DMA: 1 pages in unavailable ranges [ 0.000000] cma: Reserved 32 MiB at 0x00000000bce00000
There is error in log as "OF: reserved mem: failed to allocate memory for node 'linux,cma': size 576 MiB". This could be due to the 1GB size of DDR.
Due to this allocation error, we were getting the kernel crash when we start video streaming from camera sensor. We are using 1920x1200 resolution - 10bit mode. We are getting below error of CAM allocation when stream or capture image from camera sensor.
k location=frame%d.rawheight=1200, framerate=120/1, format=rggb10 ! multifilesink Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-bayer, width=(int)1920, height=(int)1200, framerate=(fraction)120/1, format=(string)rggb10, interlace-mode=(string)progressive, colorimetry=(string)2:4:7:1 /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-bayer, width=(int)1920, height=(int)1200, framerate=(fraction)120/1, format=(string)rggb10, interlace-mode=(string)progressive, colorimetry=(string)2:4:7:1 /GstPipeline:pipeline0/GstMultiFileSink:multifilesink0.GstPad:sink: caps = video/x-bayer, width=(int)1920, height=(int)1200, framerate=(fraction)120/1, format=(string)rggb10, interlace-mode=(string)progressive, colorimetry=(string)2:4:7:1 /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-bayer, width=(int)1920, height=(int)1200, framerate=(fraction)120/1, format=(string)rggb10, interlace-mode=(string)progressive, colorimetry=(string)2:4:7:1 [ 28.111966] ar0235 2-0036: exposure value = 1499 Redistribute latency... [ 28.333950] cma: cma_alloc: reserved: alloc failed, req-size: 1125 pages, ret: -12 [ 28.333987] ------------[ cut here ]------------ [ 28.333990] WARNING: CPU: 3 PID: 678 at mm/page_alloc.c:5535 0xffff80000813e470 [ 28.333999] Modules linked in: overlay cfg80211 rfkill xhci_plat_hcd dwc3 rpmsg_ctrl rpmsg_char cdns_csi2rx spidev crct10dif_ce phy_can_transceiver e5010_jpeg_enc dwc3_am62 k3_j72xx_bandgap rtc_ti_k3 ti_k3_r5_remoteproc ti_k3_dsp_remoteproc tidss virtio_rpmsg_bus rpmsg_ns drm_dma_helper ti_k3_common wave5 j721e_csi2rx drm_kms_helper sa2ul v4l2_mem2mem syscopyarea sysfillrect sysimgblt fb_sys_fops videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 videobuf2_common cdns_dphy_rx tps6598x ar0235 typec v4l2_fwnode m_can_platform v4l2_async m_can videodev pwm_tiehrpwm mc can_dev spi_omap2_mcspi optee_rng rng_core cryptodev(O) fuse drm drm_panel_orientation_quirks ipv6 [ 28.334149] CPU: 3 PID: 678 Comm: v4l2src0:src Tainted: G O 6.1.46-rt13-gb871cdee8c #1 [ 28.334158] Hardware name: Texas Instruments AM62A7 SK (DT) [ 28.334162] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 28.334171] pc : 0xffff80000813e470 [ 28.334174] lr : 0xffff8000080a2bb0 [ 28.334176] sp : ffff00000893b860 [ 28.334179] x29: ffff00000893b860 x28: ffff000005691860 x27: 0000000000000001 [ 28.334189] x26: 000000000000000b x25: ffff000004d812d0 x24: ffff8000080a1a18 [ 28.334200] x23: ffff0000001bac10 x22: ffff0000054f9920 x21: ffff0000001bac10 [ 28.334210] x20: 0000000000000cc0 x19: 0000000000000000 x18: ffffffffffffffff [ 28.334220] x17: 6572202c73656761 x16: 702035323131203a x15: 657a69732d716572 [ 28.334230] x14: 202c64656c696166 x13: 32312d203a746572 x12: 202c736567617020 [ 28.334240] x11: 35323131203a657a x10: 69732d716572202c x9 : ffff800008e5d050 [ 28.334251] x8 : 0000000000000000 x7 : ffff800008eb7718 x6 : 0000000000000000 [ 28.334261] x5 : 0000000000000001 x4 : 0000000000000035 x3 : 0000000000000000 [ 28.334270] x2 : 0000000000000000 x1 : 0000000000000001 x0 : ffff800008f59000 [ 28.334280] Call trace: [ 28.334283] 0xffff80000813e470 [ 28.334287] 0xffff8000080a2bb0 [ 28.334289] 0xffff8000080a2d64 [ 28.334292] 0xffff8000080a1a18 [ 28.334295] 0xffff800000bbf94c [ 28.334297] 0xffff800000ba65f4 [ 28.334300] 0xffff800000ba6c80 [ 28.334303] 0xffff800000bb13bc [ 28.334305] 0xffff800000bb1810 [ 28.334308] 0xffff800000b40564 [ 28.334311] 0xffff800000b40880 [ 28.334314] 0xffff800000b41774 [ 28.334316] 0xffff800000b41ba4 [ 28.334319] 0xffff800000b3a16c [ 28.334321] 0xffff800008182b60 [ 28.334324] 0xffff80000801de8c [ 28.334327] 0xffff80000801df80 [ 28.334329] 0xffff800008a1ccf0 [ 28.334332] 0xffff800008a1e1a4 [ 28.334335] 0xffff800008011488 [ 28.334338] ---[ end trace 0000000000000000 ]--- [ 28.334348] ti-udma 4e230000.dma-controller: dma alloc of size 4608000 failed
We are doing JPEG encoding and ISP processing on video streaming. How can we avoid CMA memory allocation error such that it won't impact our streaming functionality?
Regards,
Jay
