Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932080Ab1BCLyJ (ORCPT ); Thu, 3 Feb 2011 06:54:09 -0500 Received: from mail-pz0-f46.google.com ([209.85.210.46]:35942 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932065Ab1BCLyG (ORCPT ); Thu, 3 Feb 2011 06:54:06 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=QSiHRWBtkC6HKAma9xmzPiR2HdCRJosnHhnFflKoq1BAMFmFBRWT63XEGpjQHzrlqC PCaFw3LuvjZ7nyTK/VbFXX4Do5oqLlF7iJoB1X7oLJ7uYVhJklJCKyQ+fpASodoV6PTh ommLpkPVCkJvi3W2x3ch7mhjsPocLe17TYg2o= Date: Thu, 3 Feb 2011 19:53:49 +0800 From: Yong Zhang To: Peter Zijlstra Cc: Nick Bowler , linux-kernel@vger.kernel.org, Andrew Morton , Thomas Gleixner , Ingo Molnar Subject: [PATCH 2/2] timer: use local_bh_enable_force_wake() in del_timer_sync() Message-ID: <20110203115349.GB2121@zhy> Reply-To: Yong Zhang References: <20110203031943.GA8910@elliptictech.com> <20110203091227.GA1603@zhy> <1296725440.26581.354.camel@laptop> <20110203101739.GA1551@zhy> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20110203101739.GA1551@zhy> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5049 Lines: 114 From: Yong Zhang Subject: [PATCH 2/2] timer: use local_bh_enable_force_wake() in del_timer_sync() Nick Bowler reported: ================================= [ INFO: inconsistent lock state ] 2.6.38-rc3-bisect-00062-g8c007a1 #92 --------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes: (&(&dev->event_lock)->rlock){?.+...}, at: [] input_event+0x41/0x83 {HARDIRQ-ON-W} state was registered at: [] mark_held_locks+0x52/0x70 [] trace_hardirqs_on_caller+0xf7/0x135 [] trace_hardirqs_on+0xd/0xf [] __do_softirq+0x62/0x160 [] call_softirq+0x1c/0x28 [] _local_bh_enable_ip+0xb3/0xe3 [] local_bh_enable+0xd/0xf [] del_timer_sync+0x4f/0x8e [] rfkill_schedule_global_op+0x41/0x84 [rfkill] [] rfkill_schedule_evsw_rfkillall+0x17/0x19 [rfkill] [] rfkill_event+0x58/0x5a [rfkill] [] input_pass_event+0x97/0xea [] input_handle_event+0x460/0x46f [] input_event+0x66/0x83 [] tpacpi_send_radiosw_update+0x7f/0xc4 [thinkpad_acpi] [] hotkey_notify+0x507/0x581 [thinkpad_acpi] [] dispatch_acpi_notify+0x29/0x2b [thinkpad_acpi] [] acpi_ev_notify_dispatch+0x62/0x7c [] acpi_os_execute_deferred+0x24/0x31 [] process_one_work+0x204/0x33b [] worker_thread+0x136/0x255 [] kthread+0x7d/0x85 [] kernel_thread_helper+0x4/0x10 irq event stamp: 559266 hardirqs last enabled at (559263): [] acpi_idle_enter_bm+0x236/0x275 hardirqs last disabled at (559264): [] save_args+0x6a/0x70 softirqs last enabled at (559266): [] _local_bh_enable+0xe/0x10 softirqs last disabled at (559265): [] irq_enter+0x3d/0x6f other info that might help us debug this: 1 lock held by swapper/0: #0: (&serio->lock){-.-...}, at: [] serio_interrupt+0x24/0x7e stack backtrace: Pid: 0, comm: swapper Tainted: G W 2.6.38-rc3-bisect-00062-g8c007a1 #92 Call Trace: [] ? valid_state+0x17e/0x191 [] ? save_stack_trace+0x28/0x45 [] ? check_usage_forwards+0x0/0x87 [] ? mark_lock+0x113/0x22d [] ? __lock_acquire+0x2ac/0xd01 [] ? mark_lock+0x2d/0x22d [] ? mark_lock+0x2d/0x22d [] ? mark_lock+0x2d/0x22d [] ? lock_acquire+0x64/0x81 [] ? input_event+0x41/0x83 [] ? _raw_spin_lock_irqsave+0x53/0x65 [] ? input_event+0x41/0x83 [] ? input_event+0x41/0x83 [] ? atkbd_interrupt+0x9a/0x574 [] ? serio_interrupt+0x40/0x7e [] ? i8042_interrupt+0x28e/0x2a8 [] ? handle_IRQ_event+0x20/0xae [] ? handle_edge_irq+0xde/0x12a [] ? handle_irq+0x1f/0x2a [] ? do_IRQ+0x48/0xaf [] ? ret_from_intr+0x0/0x1a [] ? native_sched_clock+0x2d/0x5f [] ? acpi_idle_enter_bm+0x23d/0x275 [] ? acpi_idle_enter_bm+0x236/0x275 [] ? cpuidle_idle_call+0x9f/0xd5 [] ? cpu_idle+0x61/0xaa [] ? rest_init+0xcd/0xd4 [] ? rest_init+0x0/0xd4 [] ? start_kernel+0x3a6/0x3b1 [] ? x86_64_start_reservations+0xb8/0xbc [] ? x86_64_start_kernel+0x106/0x115 The cause is that local_bh_enable() could call do_softirq() in certain time, thus break irq status and make lock bite us. Reported-and-bisected-by: Nick Bowler Signed-off-by: Yong Zhang Cc: Andrew Morton Cc: Thomas Gleixner --- kernel/timer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/timer.c b/kernel/timer.c index 43ca993..1654dc1 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -972,7 +972,7 @@ int del_timer_sync(struct timer_list *timer) local_bh_disable(); lock_map_acquire(&timer->lockdep_map); lock_map_release(&timer->lockdep_map); - local_bh_enable(); + local_bh_enable_force_wake(); #endif /* * don't use it in hardirq context, because it -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/