Board: Custom board with AM5748
SDK: Custom linux based on meta-ti and meta-processor-sdk revisions for TI Processor SDK 5.02
Total system RAM: 512
There are two issues.
Issue 1.
When dsp1 FW is first time started, we sometimes see this error:
[ 21.909793] alloc_contig_range: [99800, 9ab00) PFNs busy
[ 21.916997] alloc_contig_range: [99c00, 9ac00) PFNs busy
[ 22.033134] cma: cma_alloc: alloc failed, req-size: 4096 pages, ret: -16
[ 22.042204] omap-rproc 40800000.dsp: failed to allocate dma memory: len 0x1000000
[ 22.051625] remoteproc remoteproc2: Failed to process resources: -12
[ 22.079325] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
[ 22.098460] remoteproc remoteproc2: Boot failed: -12
[ 22.103950] di-platform-start-apps.service: Started DSP processor ...
As per suggestion here: http://e2e.ti.com/support/processors/f/791/t/772040?Linux-AM5728-remoteproc-resource-failure-when-loading-DSP-firmware
we changed CMA allocation to "no-map" in DTS. This solved this problem.
dsp1_memory_region: dsp1-memory@99000000 {
compatible = "shared-dma-pool";
reg = <0x0 0x99000000 0x0 0x4000000>;
/* reusable; */
no-map;
status = "okay";
};
But we continue to see below 2nd issue (again this happens sometimes only).
Issue 2. When re-start dsp1 FW, it fails with below errors:
[ 153.613030] remoteproc remoteproc2: powering up 40800000.dsp
[ 153.618919] LoadPin: firmware pinning-ignored obj="/mnt/data/APPROOT/bin/dra7-dsp1-fw.xe66" pid=1878 cmdline="/bin/bash /mnt/data/APPROOT/bin/start_apps.sh"
[ 154.054961] remoteproc remoteproc2: Booting fw image dra7-dsp1-fw.xe66, size 20435816
[ 154.062993] start_apps.sh: page allocation failure: order:2, mode:0x108c020(GFP_ATOMIC|__GFP_COMP|__GFP_ZERO), nodemask=(null)
[ 154.078345] start_apps.sh cpuset=/ mems_allowed=0
[ 154.083139] CPU: 0 PID: 1878 Comm: start_apps.sh Tainted: G O 4.14.79-rt47-g28d73230da #1
[ 154.083142] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 154.083145] Backtrace:
[ 154.083164] [<c020bc60>] (dump_backtrace) from [<c020bf60>] (show_stack+0x18/0x1c)
[ 154.083171] r7:c1006620 r6:60080013 r5:00000000 r4:c105a538
[ 154.083181] [<c020bf48>] (show_stack) from [<c09a7eac>] (dump_stack+0x90/0xa4)
[ 154.083191] [<c09a7e1c>] (dump_stack) from [<c02f2e74>] (warn_alloc+0xe4/0x190)
[ 154.083196] r7:c1006620 r6:c0bb6fc4 r5:00000000 r4:c10064c8
[ 154.083203] [<c02f2d94>] (warn_alloc) from [<c02f3dd8>] (__alloc_pages_nodemask+0xe08/0xfa8)
[ 154.083207] r3:00000002 r2:c0bb6fc4
[ 154.083211] r6:010ac020 r5:00000000 r4:00000000
[ 154.083221] [<c02f2fd0>] (__alloc_pages_nodemask) from [<c0311b50>] (kmalloc_order+0x20/0x38)
[ 154.083228] r10:d16aca10 r9:00000000 r8:01088020 r7:c2e5e840 r6:c8270224 r5:d16aca10
[ 154.083230] r4:d17965c0
[ 154.083240] [<c0311b30>] (kmalloc_order) from [<c0651a20>] (omap_iommu_attach_dev+0xfc/0x3a8)
[ 154.083250] [<c0651924>] (omap_iommu_attach_dev) from [<c064ea20>] (__iommu_attach_device+0x4c/0x60)
[ 154.083256] r10:00000000 r9:d0585c20 r8:00000000 r7:d1787580 r6:c8270224 r5:d16aca10
[ 154.083259] r4:c8270224
[ 154.083268] [<c064e9d4>] (__iommu_attach_device) from [<c064ea7c>] (__iommu_attach_group+0x48/0x70)
[ 154.083272] r5:d17875a8 r4:d17969c0
[ 154.083279] [<c064ea34>] (__iommu_attach_group) from [<c064eb4c>] (iommu_attach_device+0x68/0xd4)
[ 154.083284] r7:d0585de4 r6:c8270224 r5:d17875b0 r4:d1787580
[ 154.083309] [<c064eae4>] (iommu_attach_device) from [<bf063108>] (rproc_boot+0x36c/0x600 [remoteproc])
[ 154.083314] r7:d0585de4 r6:d0585ddc r5:c10064c8 r4:d0585c00
[ 154.083343] [<bf062d9c>] (rproc_boot [remoteproc]) from [<bf064018>] (state_store+0x78/0x13c [remoteproc])
[ 154.083349] r10:d050c310 r9:c0033f68 r8:c3146940 r7:00000006 r6:d0585c00 r5:c3146940
[ 154.083351] r4:d0585c20
[ 154.083371] [<bf063fa0>] (state_store [remoteproc]) from [<c06c69f0>] (dev_attr_store+0x20/0x2c)
[ 154.083375] r7:00000000 r6:00000000 r5:d050c300 r4:bf063fa0
[ 154.083383] [<c06c69d0>] (dev_attr_store) from [<c03bebfc>] (sysfs_kf_write+0x40/0x4c)
[ 154.083387] r5:d050c300 r4:c06c69d0
[ 154.083394] [<c03bebbc>] (sysfs_kf_write) from [<c03be344>] (kernfs_fop_write+0xe4/0x1c8)
[ 154.083397] r5:d050c300 r4:00000006
[ 154.083405] [<c03be260>] (kernfs_fop_write) from [<c034e824>] (__vfs_write+0x40/0x14c)
[ 154.083411] r10:00000006 r9:024d3a10 r8:00000000 r7:c0033f68 r6:c82b6500 r5:c03be260
[ 154.083414] r4:c10064c8
[ 154.083421] [<c034e7e4>] (__vfs_write) from [<c034eab4>] (vfs_write+0xac/0x170)
[ 154.083426] r10:00000006 r9:024d3a10 r8:00000000 r7:c0033f68 r6:024d3a10 r5:c82b6500
[ 154.083428] r4:00000006
[ 154.083436] [<c034ea08>] (vfs_write) from [<c034ecbc>] (SyS_write+0x54/0xb4)
[ 154.083441] r9:024d3a10 r8:c82b6500 r7:00000000 r6:00000000 r5:c82b6500 r4:c10064c8
[ 154.083450] [<c034ec68>] (SyS_write) from [<c020820c>] (__sys_trace_return+0x0/0x10)
[ 154.083455] r10:00000004 r9:c0032000 r8:c0208244 r7:00000004 r6:b6eedd98 r5:024d3a10
[ 154.083457] r4:00000006
[ 154.083461] Mem-Info:
[ 154.371722] active_anon:22452 inactive_anon:23978 isolated_anon:0
[ 154.371722] active_file:16773 inactive_file:14866 isolated_file:0
[ 154.371722] unevictable:0 dirty:169 writeback:0 unstable:0
[ 154.371722] slab_reclaimable:2049 slab_unreclaimable:4042
[ 154.371722] mapped:11913 shmem:24042 pagetables:354 bounce:0
[ 154.371722] free:22199 free_pcp:21 free_cma:21034
[ 154.405676] Node 0 active_anon:89808kB inactive_anon:95912kB active_file:67092kB inactive_file:59464kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:47652kB dirty:680kB writeback:0kB shm
em:96168kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
[ 154.429176] DMA free:88796kB min:2112kB low:2640kB high:3168kB active_anon:89808kB inactive_anon:95912kB active_file:66988kB inactive_file:59464kB unevictable:0kB writepending:680kB present:488448kB ma
naged:469560kB mlocked:0kB kernel_stack:1720kB pagetables:1416kB bounce:0kB free_pcp:84kB local_pcp:84kB free_cma:84136kB
[ 154.457714] lowmem_reserve[]: 0 0 0 0
[ 154.461414] DMA: 2073*4kB (UMEC) 1172*8kB (UMEC) 474*16kB (UMC) 640*32kB (UMC) 193*64kB (C) 35*128kB (C) 12*256kB (C) 1*512kB (C) 2*1024kB (C) 2*2048kB (C) 4*4096kB (C) = 88676kB
[ 154.477491] 55687 total pagecache pages
[ 154.481345] 0 pages in swap cache
[ 154.484675] Swap cache stats: add 0, delete 0, find 0/0
[ 154.489923] Free swap = 0kB
[ 154.492815] Total swap = 0kB
[ 154.495708] 122112 pages RAM
[ 154.498600] 0 pages HighMem/MovableOnly
[ 154.503137] 4722 pages reserved
[ 154.506291] 47104 pages cma reserved
[ 154.509887] omap-rproc 40800000.dsp: failed to allocate required iommu data -12
[ 154.517267] omap-rproc 40800000.dsp: can't attach iommu device: -12
[ 154.523569] remoteproc remoteproc2: can't enable iommu: -12
[ 154.545535] remoteproc remoteproc2: Boot failed: -12
How can we avoid this issue ?
dsp1 FW is restarted using:
echo stop > /sys/class/remoteproc/remoteproc2/state
echo start > /sys/class/remoteproc/remoteproc2/state