when lock checking option enabled in kernel config, TC2 catch a deadlock bug as following,
It looks hmp_idle_pull --> hmp_keepalive_delay --> cpuidle_driver_ref interrupt into cpuidle_register_driver.
Since what we needs of cpuidle_driver in hmp_keepalive_delay are exit_latency/target_residency, they should be fixed for this board.
So, could we avoid the cpuidle_driver_ref calling by giving a fixed value? That also can save a cpuidle_get_cpu_driver?
=============== [ 113.878488] [ INFO: inconsistent lock state ] [ 113.878493] 3.10.42+ #4 Not tainted [ 113.878496] --------------------------------- [ 113.878501] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. [ 113.878507] ksoftirqd/4/28 [HC0[0]:SC1[1]:HE1:SE0] takes: [ 113.878531] (cpuidle_driver_lock){+.?...}, at: [<c035bded>] cpuidle_driver_ref+0x15/0x58 [ 113.878534] {SOFTIRQ-ON-W} state was registered at: [ 113.878545] [<c006eedd>] __lock_acquire+0x539/0x8c8 [ 113.878554] [<c006f913>] lock_acquire+0x113/0x164 [ 113.878565] [<c047e24b>] _raw_spin_lock+0x33/0x40 [ 113.878573] [<c035bc73>] cpuidle_register_driver+0x37/0xf4 [ 113.878583] [<c06bab1d>] bl_idle_init+0x85/0x128 [ 113.878592] [<c0008665>] do_one_initcall+0x99/0x11c [ 113.878603] [<c0695a5f>] kernel_init_freeable+0x10b/0x188 [ 113.878611] [<c046f96d>] kernel_init+0x19/0x108 [ 113.878619] [<c000d4a9>] ret_from_fork+0x11/0x1c [ 113.878622] irq event stamp: 28 [ 113.878633] hardirqs last enabled at (28): [<c047e48f>] _raw_spin_unlock_irqrestore+0x2f/0x44 [ 113.878642] hardirqs last disabled at (27): [<c047e335>] _raw_spin_lock_irqsave+0x19/0x4c [ 113.878652] softirqs last enabled at (0): [<c001d658>] copy_process+0x3c4/0xe34 [ 113.878661] softirqs last disabled at (17): [<c002578b>] run_ksoftirqd+0x2f/0x5c [ 113.878664] [ 113.878664] other info that might help us debug this: [ 113.878667] Possible unsafe locking scenario: [ 113.878667] [ 113.878670] CPU0 [ 113.878673] ---- [ 113.878681] lock(cpuidle_driver_lock); [ 113.878684] <Interrupt> [ 113.878691] lock(cpuidle_driver_lock); [ 113.878693] [ 113.878693] *** DEADLOCK *** [ 113.878693] [ 113.878697] 1 lock held by ksoftirqd/4/28: [ 113.878719] #0: (hmp_force_migration){+.....}, at: [<c0054da5>] hmp_idle_pull+0x49/0x508 [ 113.878722]