From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grygorii Strashko Subject: [4.1.3-rt8] [report][cpuhotplug] BUG: spinlock bad magic on CPU#0, sh/137 Date: Fri, 9 Oct 2015 09:25:49 -0500 Message-ID: <5617CE6D.9060800@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: , Eric Dumazet , To: , David Miller Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-rt-users.vger.kernel.org Hi All, I can constantly see below error report with 4.1 RT-kernel on TI ARM dra7-evm if I'm trying to unplug cpu1: [ 57.737589] CPU1: shutdown [ 57.767537] BUG: spinlock bad magic on CPU#0, sh/137 [ 57.767546] lock: 0xee994730, .magic: 00000000, .owner: /-1, .owner_cpu: 0 [ 57.767552] CPU: 0 PID: 137 Comm: sh Not tainted 4.1.10-rt8-01700-g2c38702-dirty #55 [ 57.767555] Hardware name: Generic DRA74X (Flattened Device Tree) [ 57.767568] [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [ 57.767579] [] (show_stack) from [] (dump_stack+0x84/0xa0) [ 57.767593] [] (dump_stack) from [] (spin_dump+0x84/0xac) [ 57.767603] [] (spin_dump) from [] (spin_bug+0x34/0x38) [ 57.767614] [] (spin_bug) from [] (do_raw_spin_lock+0x168/0x1c0) [ 57.767624] [] (do_raw_spin_lock) from [] (_raw_spin_lock+0x4c/0x54) [ 57.767631] [] (_raw_spin_lock) from [] (rt_spin_lock_slowlock+0x5c/0x374) [ 57.767638] [] (rt_spin_lock_slowlock) from [] (rt_spin_lock+0x38/0x70) [ 57.767649] [] (rt_spin_lock) from [] (skb_dequeue+0x28/0x7c) [ 57.767662] [] (skb_dequeue) from [] (dev_cpu_callback+0x1b8/0x240) [ 57.767673] [] (dev_cpu_callback) from [] (notifier_call_chain+0x3c/0xb4) [ 57.767683] [] (notifier_call_chain) from [] (__raw_notifier_call_chain+0x24/0x2c) [ 57.767692] [] (__raw_notifier_call_chain) from [] (cpu_notify+0x34/0x50) [ 57.767699] [] (cpu_notify) from [] (cpu_notify_nofail+0x18/0x24) [ 57.767707] [] (cpu_notify_nofail) from [] (_cpu_down+0x3e8/0x55c) [ 57.767715] [] (_cpu_down) from [] (disable_nonboot_cpus+0x118/0x5dc) [ 57.767722] [] (disable_nonboot_cpus) from [] (suspend_enter+0x2c4/0xd18) [ 57.767730] [] (suspend_enter) from [] (suspend_devices_and_enter+0xe4/0x65c) [ 57.767737] [] (suspend_devices_and_enter) from [] (enter_state+0x6c0/0x1050) [ 57.767744] [] (enter_state) from [] (pm_suspend+0x24/0x84) [ 57.767751] [] (pm_suspend) from [] (state_store+0x74/0xc8) [ 57.767760] [] (state_store) from [] (kobj_attr_store+0x1c/0x28) [ 57.767771] [] (kobj_attr_store) from [] (sysfs_kf_write+0x5c/0x60) [ 57.767781] [] (sysfs_kf_write) from [] (kernfs_fop_write+0xc8/0x1ac) [ 57.767792] [] (kernfs_fop_write) from [] (__vfs_write+0x38/0xec) [ 57.767801] [] (__vfs_write) from [] (vfs_write+0xa0/0x174) [ 57.767811] [] (vfs_write) from [] (SyS_write+0x54/0xb0) [ 57.767822] [] (SyS_write) from [] (ret_fast_syscall+0x0/0x54) [ 57.768224] Powerdomain (l3init_pwrdm) didn't enter target state 1 I'm working with TI RT-kernel: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git branch: ti-rt-linux-4.1.y It looks like this backtrace was introduces by commit 91df05da13a6c6c358e71182e80f19f3c48d1615 Author: Thomas Gleixner Date: Tue Jul 12 15:38:34 2011 +0200 net: Use skbufhead with raw lock I see the potential fix for this issue as below: index 4969c0d..f8c23de 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -7217,7 +7217,7 @@ static int dev_cpu_callback(struct notifier_block *nfb, netif_rx_ni(skb); input_queue_head_incr(oldsd); } - while ((skb = skb_dequeue(&oldsd->input_pkt_queue))) { + while ((skb = __skb_dequeue(&oldsd->input_pkt_queue))) { netif_rx_ni(skb); input_queue_head_incr(oldsd); } input_pkt_queue is per-cpu queue and at this moment cpu is dead already, so no one should touch it. But I'm not sure if my assumption is correct. -- regards, -grygorii