AnsweredAssumed Answered

请问imx7d怎么配置cma_size

Question asked by 其东 刘 on Mar 13, 2020
Latest reply on Mar 16, 2020 by Wigros Sun

大家好:

      我在使用imx7d的过程中,发现内核一直打印alloc_contig_range: [ac0c0, ac0d4) PFNs busy信息。后面查询这个信息和dma相关。再查看了自己的内核配置,发现内核里面cma_size的大小是0.后面通过make menuconfig进入UI界面,将cma_size的大小设置成256Mbyte。进行这个更改后,内核没有再打印alloc_contig_range: [ac0c0, ac0d4) PFNs busy信息。但是在使用0.5-1天的时间里,内核会出现死机的问题。死机信息如下日志。

      在论坛里面查找了cma_size的配置。提示说还需要在dts里面进程操作。我反编译我的dtb问题。发现在dts里面的配置如下:

reserved-memory {
#address-cells = <0x1>;
#size-cells = <0x1>;
ranges;

linux,cma {
compatible = "shared-dma-pool";
reusable;
size = <0x14000000>;
linux,cma-default;
};
};

      我发现该配置和我的imx6d的配置是一样的。请问针对imx7d,这样的配置是否正确,是否存在漏配置了其他的信息?大家能给出一个正确的配置作参考吗?

      针对我的问题,希望大家多指导一下。谢谢

 

死机信息日志如下:

Unable to handle kernel NULL pointer dereference at virtual address 000002f6
pgd = a8ed4000
[000002f6] *pgd=a8ccf835, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 843 Comm: KMonitor Not tainted 4.9.88 #196
Hardware name: Freescale i.MX7 Dual (Device Tree)
task: a84fc200 task.stack: a87e0000
PC is at sdma_int_handler+0xd8/0x2f8
LR is at _raw_spin_lock+0x10/0x50
pc : [<80450e0c>] lr : [<80925518>] psr: 600d0193
sp : a87e1d60 ip : a902ccbc fp : 00000001
r10: a83a4010 r9 : a8bb6d80 r8 : 00000000
r7 : 00000000 r6 : a83a47a0 r5 : 00000007 r4 : a83a4748
r3 : 000002f4 r2 : 000000bd r1 : 00000000 r0 : 00000001
Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
Control: 10c53c7d Table: a8ed406a DAC: 00000051
Process KMonitor (pid: 843, stack limit = 0xa87e0210)
Stack: (0xa87e1d60 to 0xa87e2000)
1d60: ffffffff a83a47a0 00000000 00000080 00000000 00000000 80f58310 a8392300
1d80: a814e800 00000000 a87e1dcc 00000040 a814e800 810906b8 75e87940 8017136c
1da0: 00000000 810d90c0 a814e800 a814e800 8100a880 00000000 00000001 a87e1e50
1dc0: a8008000 80171418 a8f53c80 00000000 75e87940 a814e800 a814e860 8017148c
1de0: a814e800 a814e860 8100a880 80174804 80174734 80f5bd80 00000000 00000040
1e00: 00000000 8017065c 00000130 80170b64 8101c000 810033f4 c080200c a87e1e50
1e20: c0802000 c0803000 a815ea08 801014c4 801940f4 801940f4 800d0013 ffffffff
1e40: a87e1e84 00000001 a87e0000 8010bd0c a87e1eac 00000000 a8f596c0 00000000
1e60: a815e9fc 00000001 a87e1ea4 ffffffff 00000001 a815ea04 a815ea08 75e87940
1e80: 00000002 a87e1ea0 801940f4 801940f4 800d0013 ffffffff 00000051 7f000000
1ea0: 80921ddc a84fd694 a84fd694 75e87000 a8f596c0 00000940 fffffffb 00000001
1ec0: 00000000 000000f0 00000001 75e87940 00000081 80195da0 a87e1fb0 4ecf29bd
1ee0: 81002d00 8014f9ec ab723a40 80f5da40 80f5da40 8014fa08 a84fa100 a84fa100
1f00: a87e1f4c 80925838 00000000 8014e510 ffffffff 8014aa00 ffffffff a8b66000
1f20: 00000002 a84fa100 00000000 a84fa100 ab723a40 a84fc200 a8f596c0 00000000
1f40: 00000001 00000001 000000f0 00000001 a87e0000 00000081 75e87940 8019696c
1f60: 7eadcebc 00000000 ffffffff a87e0000 00000000 a87e1fb0 10c53c7d 00000000
1f80: a87e0000 4ecf29bd 7eadcebc 7eadce94 00000001 000000f0 801079c4 00000000
1fa0: 000001ec 80107800 7eadcebc 7eadce94 75e87940 00000081 00000001 00000000
1fc0: 7eadcebc 7eadce94 00000001 000000f0 7eadce94 00000075 4ecf29bd 000001ec
1fe0: 00000001 7eadce48 75ddb0fc 75ddb34c 200d0010 75e87940 00000000 00000000
[<80450e0c>] (sdma_int_handler) from [<8017136c>] (__handle_irq_event_percpu+0x88/0x118)
[<8017136c>] (__handle_irq_event_percpu) from [<80171418>] (handle_irq_event_percpu+0x1c/0x58)
[<80171418>] (handle_irq_event_percpu) from [<8017148c>] (handle_irq_event+0x38/0x5c)
[<8017148c>] (handle_irq_event) from [<80174804>] (handle_fasteoi_irq+0xd0/0x1a8)
[<80174804>] (handle_fasteoi_irq) from [<8017065c>] (generic_handle_irq+0x24/0x34)
[<8017065c>] (generic_handle_irq) from [<80170b64>] (__handle_domain_irq+0x7c/0xec)
[<80170b64>] (__handle_domain_irq) from [<801014c4>] (gic_handle_irq+0x48/0x8c)
[<801014c4>] (gic_handle_irq) from [<8010bd0c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xa87e1e50 to 0xa87e1e98)
1e40: a87e1eac 00000000 a8f596c0 00000000
1e60: a815e9fc 00000001 a87e1ea4 ffffffff 00000001 a815ea04 a815ea08 75e87940
1e80: 00000002 a87e1ea0 801940f4 801940f4 800d0013 ffffffff
[<8010bd0c>] (__irq_svc) from [<801940f4>] (futex_wake+0x64/0x150)
[<801940f4>] (futex_wake) from [<80195da0>] (do_futex+0x12c/0xba8)
[<80195da0>] (do_futex) from [<8019696c>] (SyS_futex+0x150/0x190)
[<8019696c>] (SyS_futex) from [<80107800>] (ret_fast_syscall+0x0/0x48)
Code: e5992044 e5993050 e0822082 e0833102 (e5d32002)
---[ end trace 985f1eea88b5b4a3 ]---
Kernel panic - not syncing: Fatal exception in interrupt
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D 4.9.88 #196
Hardware name: Freescale i.MX7 Dual (Device Tree)
[<8010eb84>] (unwind_backtrace) from [<8010b328>] (show_stack+0x10/0x14)
[<8010b328>] (show_stack) from [<803c00c8>] (dump_stack+0x88/0x9c)
[<803c00c8>] (dump_stack) from [<8010d9cc>] (handle_IPI+0x198/0x1ac)
[<8010d9cc>] (handle_IPI) from [<80101504>] (gic_handle_irq+0x88/0x8c)
[<80101504>] (gic_handle_irq) from [<8010bd0c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xa80adf58 to 0xa80adfa0)
df40: 00000000 ab734700
df60: 00000001 00000001 00000001 ab730f40 24560362 0000066f 243ae86b 0000066f
df80: 00000000 81003144 80727618 a80adfa8 80925790 80694a64 200e0013 ffffffff
[<8010bd0c>] (__irq_svc) from [<80694a64>] (cpuidle_enter_state+0x11c/0x264)
[<80694a64>] (cpuidle_enter_state) from [<8016781c>] (cpu_startup_entry+0x148/0x21c)
[<8016781c>] (cpu_startup_entry) from [<801015ac>] (__enable_mmu+0x0/0x14)
---[ end Kernel panic - not syncing: Fatal exception in interrupt

Outcomes