From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030674AbbDWTgk (ORCPT ); Thu, 23 Apr 2015 15:36:40 -0400 Received: from www.linutronix.de ([62.245.132.108]:38777 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030357AbbDWTgi (ORCPT ); Thu, 23 Apr 2015 15:36:38 -0400 Date: Thu, 23 Apr 2015 21:36:55 +0200 (CEST) From: Thomas Gleixner To: Sudeep Holla cc: "linux-kernel@vger.kernel.org" , "Rafael J. Wysocki" Subject: Re: inconsistent lock state with tick_broadcast_lock In-Reply-To: <55390F8C.5040307@arm.com> Message-ID: References: <55390F8C.5040307@arm.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 Apr 2015, Sudeep Holla wrote: > Hi Thomas/Rafael, > > With latest mainline(commit 27cf3a16b2535a490f8cf1d29a6634f1c70f7831), > and lockdep enabled I see the following inconsistent lock state log. > I am not sure if it's related to recent changes in tick-broadcast or I > might be missing any config ? It's surely not the config. > inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. > [] (unwind_backtrace) from [] (show_stack+0x11/0x14) > [] (show_stack) from [] (dump_stack+0x6d/0x78) > [] (dump_stack) from [] (print_usage_bug+0x1d9/0x260) > [] (print_usage_bug) from [] (mark_lock+0x173/0x5d0) > [] (mark_lock) from [] (__lock_acquire+0x699/0x19ec) > [] (__lock_acquire) from [] (lock_acquire+0x79/0xe8) > [] (lock_acquire) from [] (_raw_spin_lock+0x23/0x30) > [] (_raw_spin_lock) from [] > (tick_broadcast_oneshot_control+0x45/0x1ec) > [] (tick_broadcast_oneshot_control) from [] > (cpu_startup_entry+0x2c3/0x2f8) > [] (cpu_startup_entry) from [<800093d1>] (0x800093d1) So tick_broadcast_oneshot_control is called from cpu_startup_entry with interrupts enabled. That's from the guts of the idle loop. So something in the idle magic enables interrupts where it should not. > Also with CPUIdle enabled, the system has spinlock lockup as below: > > BUG: spinlock lockup suspected on CPU#0, swapper/0/0 > lock: tick_broadcast_lock+0x0/0x40, .magic: dead4ead, .owner: swapper/0/0, > .owner_cpu: 0 > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.0.0 #1 > Hardware name: ARM-Versatile Express > [] (unwind_backtrace) from [] (show_stack+0x11/0x14) > [] (show_stack) from [] (dump_stack+0x6d/0x78) > [] (dump_stack) from [] (do_raw_spin_lock+0xc3/0x144) > [] (do_raw_spin_lock) from [] > (tick_handle_oneshot_broadcast+0x25/0x164) > [] (tick_handle_oneshot_broadcast) from [] > (sp804_timer_interrupt+0x31/0x34) > [] (sp804_timer_interrupt) from [] > (handle_irq_event_percpu+0x45/0x154) > [] (handle_irq_event_percpu) from [] > (handle_irq_event+0x2f/0x44) > [] (handle_irq_event) from [] > (handle_fasteoi_irq+0x6f/0xf0) > [] (handle_fasteoi_irq) from [] > (generic_handle_irq+0x23/0x2c) > [] (generic_handle_irq) from [] > (__handle_domain_irq+0x45/0x84) > [] (__handle_domain_irq) from [] > (gic_handle_irq+0x27/0x50) > [] (gic_handle_irq) from [] (__irq_svc+0x3f/0x64) > Exception stack(0xc07e7ee0 to 0xc07e7f28) > 7ee0: 00000000 00000001 00000000 00000000 c07ed938 c07f6e10 c0081431 60000153 > 7f00: 00000001 c0865a80 c07e7f88 c051dfc8 00000000 c07e7f28 c005a40b c005a466 > 7f20: 60000173 ffffffff > [] (__irq_svc) from [] (lock_release+0xaa/0x1c4) > [] (lock_release) from [] (_raw_spin_unlock+0x15/0x1c) > [] (_raw_spin_unlock) from [] > (tick_broadcast_oneshot_control+0x75/0x1ec) > [] (tick_broadcast_oneshot_control) from [] > (cpu_startup_entry+0x2c3/0x2f8) > [] (cpu_startup_entry) from [] (start_kernel+0x327/0x330) Which is exactly the lockup which lockdep warned about .... Thanks, tglx