From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752116AbdBMIr0 (ORCPT ); Mon, 13 Feb 2017 03:47:26 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:37809 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751938AbdBMIrY (ORCPT ); Mon, 13 Feb 2017 03:47:24 -0500 Date: Mon, 13 Feb 2017 09:47:15 +0100 (CET) From: Thomas Gleixner To: Mike Galbraith cc: Gabriel C , Borislav Petkov , Linus Torvalds , Greg KH , Linux Kernel Mailing List , Andrew Morton , stable , lwn@lwn.net, Jiri Slaby , Ruslan Ruslichenko Subject: Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box ) In-Reply-To: <1486953115.5912.4.camel@gmx.de> Message-ID: References: <1e88cc0e-4d34-a314-a44f-8324335b79e3@gmail.com> <73c6bd86-3ebb-c6db-b522-47a48b847227@gmail.com> <20170211142059.447eo6bgxycmp6kb@pd.tnic> <20170211213221.p6xs6c7qccz2w42r@pd.tnic> <0da9ef61-f3ee-13a8-2877-c235d710c50f@gmail.com> <20170212211228.iycyl76o4auxk2jy@pd.tnic> <20170213003804.7gt2edclorjlx52p@pd.tnic> <1486953115.5912.4.camel@gmx.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Feb 2017, Mike Galbraith wrote: > kernel/time/tick-broadcast.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > --- a/kernel/time/tick-broadcast.c > +++ b/kernel/time/tick-broadcast.c > @@ -357,6 +357,7 @@ void tick_broadcast_control(enum tick_br > struct clock_event_device *bc, *dev; > struct tick_device *td; > int cpu, bc_stopped; > + unsigned long flags; > > td = this_cpu_ptr(&tick_cpu_device); > dev = td->evtdev; > @@ -370,7 +371,7 @@ void tick_broadcast_control(enum tick_br > if (!tick_device_is_functional(dev)) > return; > > - raw_spin_lock(&tick_broadcast_lock); > + raw_spin_lock_irqsave(&tick_broadcast_lock, flags); > cpu = smp_processor_id(); > bc = tick_broadcast_device.evtdev; > bc_stopped = cpumask_empty(tick_broadcast_mask); > @@ -420,7 +421,7 @@ void tick_broadcast_control(enum tick_br > tick_broadcast_setup_oneshot(bc); > } > } > - raw_spin_unlock(&tick_broadcast_lock); > + raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags); That cures the lockdep splat, but the comment above tick_broadcast_control() says: * Called with interrupts disabled, so clockevents_lock is not * required here because the local clock event device cannot go away * under us. So if we want to relax the calling convention, then we need to take the lock early. Otherwise it's unsafe to fiddle with the local clock event device. The calling convention was broken with the following commit: 29d7bbada98e intel_idle: Remove superfluous SMP fuction call So we could fix it at the call site, but making the core more robust is the better solution. I'll fix it up. Thanks, tglx