I have enabled the imx-cpufreq-dt module (CONFIG_ARM_IMX_CPUFREQ_DT) in the kernel (mainline, 5.10.197), which causes a stack overflow in the kernel at startup:
[ 3.425062] imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 2 mkt segment 2 supported-hw 0x4 0x4
[ 3.438041] Insufficient stack space to handle exception!
[ 3.438045] ESR: 0x96000047 -- DABT (current EL)
[ 3.438048] FAR: 0xffff8000131a7ff0
[ 3.438051] Task stack: [0xffff8000131a8000..0xffff8000131ac000]
[ 3.438053] IRQ stack: [0xffff800011200000..0xffff800011204000]
[ 3.438056] Overflow stack: [0xffff00003fdb3090..0xffff00003fdb4090]
[ 3.438058] CPU: 3 PID: 969 Comm: sugov:0 Not tainted 5.10.197 #1
[ 3.438061] Hardware name: Logic Board V2 (DT)
[ 3.438063] pstate: 00000085 (nzcv daIf -PAN -UAO -TCO BTYPE=--)
[ 3.438065] pc : unwind_frame+0x0/0x1b4
[ 3.438067] lr : walk_stackframe+0x40/0x54
[ 3.438069] sp : ffff8000131a8040
[ 3.438071] x29: ffff8000131a8040 x28: ffff000002b26568
[ 3.438079] x27: ffff000002b26c68 x26: ffff000002b26b00
[ 3.438084] x25: ffff000002b26500 x24: ffff000002b26c00
[ 3.438090] x23: 000000002faf0800 x22: ffff8000131a8070
[ 3.438094] x21: ffff80001000ea84 x20: ffff000002204380
[ 3.438100] x19: ffff8000131a8080 x18: 0000000000000000
[ 3.438104] x17: 0000000048e5cbee x16: 000000004f1627e2
[ 3.438110] x15: ffff000002c62720 x14: 0000000000000000
[ 3.438115] x13: 0000000100000000 x12: 0000000100000001
[ 3.438120] x11: 0000000000000005 x10: 0000000000000990
[ 3.438125] x9 : ffff80001046b7bc x8 : 00000000000f4240
[ 3.438130] x7 : 0000000000000000 x6 : ffff000002123028
[ 3.438135] x5 : 0000000000000003 x4 : 0000000000000000
[ 3.438140] x3 : ffff8000131a8070 x2 : 0000000000000002
[ 3.438145] x1 : ffff8000131a8080 x0 : ffff000002204380
[ 3.438151] Kernel panic - not syncing: kernel stack overflow
[ 3.438154] CPU: 3 PID: 969 Comm: sugov:0 Not tainted 5.10.197 #1
[ 3.438156] Hardware name: Logic Board V2 (DT)
[ 3.438158] Call trace:
[ 3.438160] dump_backtrace+0x0/0x1ec
[ 3.438162] show_stack+0x1c/0x24
[ 3.438164] dump_stack+0x108/0x158
[ 3.438165] panic+0x168/0x358
[ 3.438168] nmi_panic+0x50/0x70
[ 3.438170] handle_bad_stack+0x110/0x11c
[ 3.438172] __bad_stack+0x98/0x9c
[ 3.438174] unwind_frame+0x0/0x1b4
[ 3.438176] return_address+0x54/0x8c
[ 3.438177] trace_hardirqs_on+0x78/0xf8
[ 3.438180] __raw_spin_unlock_irqrestore+0x28/0x54
[ 3.438182] _raw_spin_unlock_irqrestore+0x14/0x1c
[ 3.438184] clk_enable_unlock+0x58/0x64
[ 3.438186] clk_core_enable_lock+0x34/0x44
[ 3.438189] clk_core_prepare_enable.isra.0+0x38/0x58
[ 3.438191] clk_change_rate+0xe4/0x2d8
[ 3.438193] clk_change_rate+0x2a0/0x2d8
[ 3.438195] clk_change_rate+0x2a0/0x2d8
[ 3.438197] clk_change_rate+0x2a0/0x2d8
[ 3.438199] clk_change_rate+0x2a0/0x2d8
[ 3.438202] clk_core_set_rate_nolock+0x164/0x194
[ 3.438204] clk_set_rate+0x40/0x70
[ 3.438206] clk_cpu_set_rate+0x40/0x78
[ 3.438208] clk_change_rate+0x198/0x2d8
[ 3.438210] clk_change_rate+0x2a0/0x2d8
[ 3.438212] clk_change_rate+0x2a0/0x2d8
[ 3.438214] clk_change_rate+0x2a0/0x2d8
[ 3.438216] clk_change_rate+0x2a0/0x2d8
[ 3.438218] clk_change_rate+0x2a0/0x2d8
[ 3.438220] clk_core_set_rate_nolock+0x164/0x194
[ 3.438223] clk_set_rate+0x40/0x70
[ 3.438225] clk_cpu_set_rate+0x40/0x78
[ 3.438227] clk_change_rate+0x198/0x2d8
[ 3.438229] clk_change_rate+0x2a0/0x2d8
[ 3.438231] clk_change_rate+0x2a0/0x2d8
[ 3.438233] clk_change_rate+0x2a0/0x2d8
[ 3.438235] clk_change_rate+0x2a0/0x2d8
[ 3.438237] clk_change_rate+0x2a0/0x2d8
[ 3.438240] clk_core_set_rate_nolock+0x164/0x194
[ 3.438241] clk_set_rate+0x40/0x70
[ 3.438243] clk_cpu_set_rate+0x40/0x78
[ 3.438246] clk_change_rate+0x198/0x2d8
[ 3.438248] clk_change_rate+0x2a0/0x2d8
[ 3.438250] clk_change_rate+0x2a0/0x2d8
[ 3.438252] clk_change_rate+0x2a0/0x2d8
[ 3.438254] clk_change_rate+0x2a0/0x2d8
[ 3.438256] clk_change_rate+0x2a0/0x2d8
[ 3.438259] clk_core_set_rate_nolock+0x164/0x194
[ 3.438260] clk_set_rate+0x40/0x70
[ 3.438263] clk_cpu_set_rate+0x40/0x78
[ 3.438264] clk_change_rate+0x198/0x2d8
[ 3.438267] clk_change_rate+0x2a0/0x2d8
[ 3.438269] clk_change_rate+0x2a0/0x2d8
[ 3.438271] clk_change_rate+0x2a0/0x2d8
[ 3.438273] clk_change_rate+0x2a0/0x2d8
[ 3.438275] clk_change_rate+0x2a0/0x2d8
[ 3.438277] clk_core_set_rate_nolock+0x164/0x194
[ 3.438279] clk_set_rate+0x40/0x70
[ 3.438281] clk_cpu_set_rate+0x40/0x78
[ 3.438283] clk_change_rate+0x198/0x2d8
[ 3.438286] clk_change_rate+0x2a0/0x2d8
[ 3.438288] clk_change_rate+0x2a0/0x2d8
[ 3.438290] clk_change_rate+0x2a0/0x2d8
[ 3.438292] clk_change_rate+0x2a0/0x2d8
[ 3.438294] clk_change_rate+0x2a0/0x2d8
[ 3.438296] clk_core_set_rate_nolock+0x164/0x194
[ 3.438298] clk_set_rate+0x40/0x70
[ 3.438300] clk_cpu_set_rate+0x40/0x78
[ 3.438303] clk_change_rate+0x198/0x2d8
[ 3.438305] clk_change_rate+0x2a0/0x2d8
[ 3.438307] clk_change_rate+0x2a0/0x2d8
[ 3.438309] clk_change_rate+0x2a0/0x2d8
[ 3.438311] clk_change_rate+0x2a0/0x2d8
[ 3.438313] clk_change_rate+0x2a0/0x2d8
[ 3.438315] clk_core_set_rate_nolock+0x164/0x194
[ 3.438317] clk_set_rate+0x40/0x70
[ 3.438319] clk_cpu_set_rate+0x40/0x78
[ 3.438321] clk_change_rate+0x198/0x2d8
[ 3.438324] clk_change_rate+0x2a0/0x2d8
[ 3.438326] clk_change_rate+0x2a0/0x2d8
[ 3.438328] clk_change_rate+0x2a0/0x2d8
[ 3.438330] clk_change_rate+0x2a0/0x2d8
[ 3.438332] clk_change_rate+0x2a0/0x2d8
[ 3.438334] clk_core_set_rate_nolock+0x164/0x194
[ 3.438336] clk_set_rate+0x40/0x70
[ 3.438338] clk_cpu_set_rate+0x40/0x78
[ 3.438340] clk_change_rate+0x198/0x2d8
[ 3.438342] clk_change_rate+0x2a0/0x2d8
[ 3.438344] clk_change_rate+0x2a0/0x2d8
[ 3.438346] clk_change_rate+0x2a0/0x2d8
[ 3.438348] clk_change_rate+0x2a0/0x2d8
[ 3.438350] clk_change_rate+0x2a0/0x2d8
[ 3.438353] clk_core_set_rate_nolock+0x164/0x194
[ 3.438355] clk_set_rate+0x40/0x70
[ 3.438357] clk_cpu_set_rate+0x40/0x78
[ 3.438359] clk_change_rate+0x198/0x2d8
[ 3.438361] clk_change_rate+0x2a0/0x2d8
[ 3.438363] clk_change_rate+0x2a0/0x2d8
[ 3.438365] clk_change_rate+0x2a0/0x2d8
[ 3.438367] clk_change_rate+0x2a0/0x2d8
[ 3.438370] clk_change_rate+0x2a0/0x2d8
[ 3.438372] clk_core_set_rate_nolock+0x164/0x194
[ 3.438374] clk_set_rate+0x40/0x70
[ 3.438376] clk_cpu_set_rate+0x40/0x78
[ 3.438378] clk_change_rate+0x198/0x2d8
[ 3.438380] clk_change_rate+0x2a0/0x2d8
[ 3.438382] clk_change_rate+0x2a0/0x2d8
[ 3.438384] clk_change_rate+0x2a0/0x2d8
[ 3.438387] clk_change_rate+0x2a0/0x2d8
[ 3.438389] clk_change_rate+0x2a0/0x2d8
[ 3.438391] clk_core_set_rate_nolock+0x164/0x194
[ 3.438393] clk_set_rate+0x40/0x70
[ 3.438395] clk_cpu_set_rate+0x40/0x78
[ 3.438397] clk_change_rate+0x198/0x2d8
[ 3.438399] clk_change_rate+0x2a0/0x2d8
[ 3.438401] clk_change_rate+0x2a0/0x2d8
[ 3.438404] clk_change_rate+0x2a0/0x2d8
[ 3.438405] clk_change_rate+0x2a0/0x2d8
[ 3.438408] clk_change_rate+0x2a0/0x2d8
[ 3.438410] clk_core_set_rate_nolock+0x164/0x194
[ 3.438412] clk_set_rate+0x40/0x70
[ 3.438414] clk_cpu_set_rate+0x40/0x78
[ 3.438416] clk_change_rate+0x198/0x2d8
[ 3.438418] clk_change_rate+0x2a0/0x2d8
[ 3.438420] clk_change_rate+0x2a0/0x2d8
[ 3.438422] clk_change_rate+0x2a0/0x2d8
[ 3.438424] clk_change_rate+0x2a0/0x2d8
[ 3.438426] clk_change_rate+0x2a0/0x2d8
[ 3.438429] clk_core_set_rate_nolock+0x164/0x194
[ 3.438431] clk_set_rate+0x40/0x70
[ 3.438433] clk_cpu_set_rate+0x40/0x78
[ 3.438435] clk_change_rate+0x198/0x2d8
[ 3.438437] clk_change_rate+0x2a0/0x2d8
[ 3.438439] clk_change_rate+0x2a0/0x2d8
[ 3.438441] clk_change_rate+0x2a0/0x2d8
[ 3.438443] clk_change_rate+0x2a0/0x2d8
[ 3.438445] clk_change_rate+0x2a0/0x2d8
[ 3.438447] clk_core_set_rate_nolock+0x164/0x194
[ 3.438450] clk_set_rate+0x40/0x70
[ 3.438452] clk_cpu_set_rate+0x40/0x78
[ 3.438454] clk_change_rate+0x198/0x2d8
[ 3.438456] clk_change_rate+0x2a0/0x2d8
[ 3.438458] clk_change_rate+0x2a0/0x2d8
[ 3.438460] clk_change_rate+0x2a0/0x2d8
[ 3.438462] clk_change_rate+0x2a0/0x2d8
[ 3.438464] clk_change_rate+0x2a0/0x2d8
[ 3.438466] clk_core_set_rate_nolock+0x164/0x194
[ 3.438468] clk_set_rate+0x40/0x70
[ 3.438471] clk_cpu_set_rate+0x40/0x78
[ 3.438473] clk_change_rate+0x198/0x2d8
[ 3.438475] clk_change_rate+0x2a0/0x2d8
[ 3.438477] clk_change_rate+0x2a0/0x2d8
[ 3.438479] clk_change_rate+0x2a0/0x2d8
[ 3.438481] clk_change_rate+0x2a0/0x2d8
[ 3.438483] clk_change_rate+0x2a0/0x2d8
[ 3.438485] clk_core_set_rate_nolock+0x164/0x194
[ 3.438488] clk_set_rate+0x40/0x70
[ 3.438490] clk_cpu_set_rate+0x40/0x78
[ 3.438492] clk_change_rate+0x198/0x2d8
[ 3.438494] clk_change_rate+0x2a0/0x2d8
[ 3.438496] clk_change_rate+0x2a0/0x2d8
[ 3.438498] clk_change_rate+0x2a0/0x2d8
[ 3.438500] clk_change_rate+0x2a0/0x2d8
[ 3.438502] clk_change_rate+0x2a0/0x2d8
[ 3.438505] clk_core_set_rate_nolock+0x164/0x194
[ 3.438507] clk_set_rate+0x40/0x70
[ 3.438509] clk_cpu_set_rate+0x40/0x78
[ 3.438511] clk_change_rate+0x198/0x2d8
[ 3.438513] clk_change_rate+0x2a0/0x2d8
[ 3.438515] clk_change_rate+0x2a0/0x2d8
[ 3.438517] clk_change_rate+0x2a0/0x2d8
[ 3.438519] clk_change_rate+0x2a0/0x2d8
[ 3.438521] clk_change_rate+0x2a0/0x2d8
[ 3.438523] clk_core_set_rate_nolock+0x164/0x194
[ 3.438525] clk_set_rate+0x40/0x70
[ 3.438528] clk_cpu_set_rate+0x40/0x78
[ 3.438530] clk_change_rate+0x198/0x2d8
[ 3.438532] clk_change_rate+0x2a0/0x2d8
[ 3.438534] clk_change_rate+0x2a0/0x2d8
[ 3.438536] clk_change_rate+0x2a0/0x2d8
[ 3.438538] clk_change_rate+0x2a0/0x2d8
[ 3.438540] clk_change_rate+0x2a0/0x2d8
[ 3.438542] clk_core_set_rate_nolock+0x164/0x194
[ 3.438544] clk_set_rate+0x40/0x70
[ 3.438546] clk_cpu_set_rate+0x40/0x78
[ 3.438548] clk_change_rate+0x198/0x2d8
[ 3.438550] clk_change_rate+0x2a0/0x2d8
[ 3.438552] clk_change_rate+0x2a0/0x2d8
[ 3.438555] clk_change_rate+0x2a0/0x2d8
[ 3.438557] clk_change_rate+0x2a0/0x2d8
[ 3.438559] clk_change_rate+0x2a0/0x2d8
[ 3.438561] clk_core_set_rate_nolock+0x164/0x194
[ 3.438563] clk_set_rate+0x40/0x70
[ 3.438565] clk_cpu_set_rate+0x40/0x78
[ 3.438567] clk_change_rate+0x198/0x2d8
[ 3.438569] clk_change_rate+0x2a0/0x2d8
[ 3.438571] clk_change_rate+0x2a0/0x2d8
[ 3.438573] clk_change_rate+0x2a0/0x2d8
[ 3.438576] clk_change_rate+0x2a0/0x2d8
[ 3.438578] clk_change_rate+0x2a0/0x2d8
[ 3.438580] clk_core_set_rate_nolock+0x164/0x194
[ 3.438582] clk_set_rate+0x40/0x70
[ 3.438584] clk_cpu_set_rate+0x40/0x78
[ 3.438586] clk_change_rate+0x198/0x2d8
[ 3.438588] clk_change_rate+0x2a0/0x2d8
[ 3.438590] clk_change_rate+0x2a0/0x2d8
[ 3.438592] clk_change_rate+0x2a0/0x2d8
[ 3.438594] clk_change_rate+0x2a0/0x2d8
[ 3.438596] clk_change_rate+0x2a0/0x2d8
[ 3.438599] clk_core_set_rate_nolock+0x164/0x194
[ 3.438601] clk_set_rate+0x40/0x70
[ 3.438603] clk_cpu_set_rate+0x40/0x78
[ 3.438605] clk_change_rate+0x198/0x2d8
[ 3.438607] clk_change_rate+0x2a0/0x2d8
[ 3.438609] clk_change_rate+0x2a0/0x2d8
[ 3.438612] clk_change_rate+0x2a0/0x2d8
[ 3.438613] clk_change_rate+0x2a0/0x2d8
[ 3.438615] clk_change_rate+0x2a0/0x2d8
[ 3.438618] clk_core_set_rate_nolock+0x164/0x194
[ 3.438620] clk_set_rate+0x40/0x70
[ 3.438622] clk_cpu_set_rate+0x40/0x78
[ 3.438624] clk_change_rate+0x198/0x2d8
[ 3.438626] clk_core_set_rate_nolock+0x164/0x194
[ 3.438628] clk_set_rate+0x40/0x70
[ 3.438631] _generic_set_opp_clk_only+0x1c/0x54
[ 3.438633] dev_pm_opp_set_rate+0x448/0x4dc
[ 3.438635] set_target+0x34/0x3c
[ 3.438637] __cpufreq_driver_target+0x228/0x300
[ 3.438639] sugov_work+0x58/0x70
[ 3.438641] kthread_worker_fn+0xa0/0xe4
[ 3.438643] kthread
[ 3.438646] Lost 1 message(s)!
[ 3.438667] SMP: stopping secondary CPUs
[ 3.438669] Kernel Offset: disabled
[ 3.438671] CPU features: 0x00040002,2000200c
[ 3.438673] Memory Limit: none
I have stepped through clk_change_rate using gdb and it is trying to transition from 800Mhz to 1.3Ghz but not sure why it keeps calling itself until the stack runs out.
Any ideas what might be causing this behaviour?
Many thanks in advance
Hello,
The CONFIG_ARM_IMX_CPUFREQ_DT is unstable un 5.10 kernel, better try on 6.6.:
Regards