From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756840AbbBQObY (ORCPT ); Tue, 17 Feb 2015 09:31:24 -0500 Received: from foss.arm.com ([217.140.101.70]:52955 "EHLO usa-sjc-mx-foss1.foss.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752606AbbBQObX (ORCPT ); Tue, 17 Feb 2015 09:31:23 -0500 Date: Tue, 17 Feb 2015 14:31:42 +0000 From: Lorenzo Pieralisi To: Peter Zijlstra Cc: "linux-kernel@vger.kernel.org" , "mingo@kernel.org" , "rjw@rjwysocki.net" , "tglx@linutronix.de" , Nicolas Pitre , Russell King Subject: Re: [PATCH 34/35] tick: Provide tick_suspend_local() Message-ID: <20150217143142.GB15881@red-moon> References: <20150216121435.203983131@infradead.org> <20150216122414.010100318@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150216122414.010100318@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 16, 2015 at 12:15:09PM +0000, Peter Zijlstra wrote: > From: Thomas Gleixner > > This function is intended to use by the freezer once the freezer folks > solved their race issues. Also required to get rid of the ARM BL > switcher tick hackery. Totally agree with the patch(es), but I noticed that the ARM bL switcher does not depend on PM_SLEEP, so I do not think you can compile tick_{suspend/resume}_local() out if !PM_SLEEP, unless dependency is enforced by the ARM bL switcher config but I do not think that the config dependency really exists, Nico please correct me if I am wrong. Lorenzo > > Signed-off-by: Thomas Gleixner > Cc: Nicolas Pitre > Cc: Russell King > > --- > include/linux/tick.h | 3 +++ > kernel/time/tick-common.c | 18 +++++++++++++++--- > 2 files changed, 18 insertions(+), 3 deletions(-) > > Index: linux/include/linux/tick.h > =================================================================== > --- linux.orig/include/linux/tick.h > +++ linux/include/linux/tick.h > @@ -27,12 +27,15 @@ extern struct tick_device *tick_get_devi > > #ifdef CONFIG_GENERIC_CLOCKEVENTS > extern void __init tick_init(void); > +/* Should be core only, but arm BL switcher has its homebrewn implementation */ > +extern void tick_suspend_local(void); > /* Should be core only, but XEN resume magic requires this */ > extern void tick_resume_local(void); > /* CPU hotplug */ > extern void tick_shutdown_local(void); > #else /* CONFIG_GENERIC_CLOCKEVENTS */ > static inline void tick_init(void) { } > +static inline void tick_suspend_local(void) { } > static inline void tick_resume_local(void) { } > static inline void tick_shutdown_local(void) { } > #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ > Index: linux/kernel/time/tick-common.c > =================================================================== > --- linux.orig/kernel/time/tick-common.c > +++ linux/kernel/time/tick-common.c > @@ -370,6 +370,20 @@ void tick_shutdown_local(void) > > #ifdef CONFIG_PM_SLEEP > /** > + * tick_suspend_local - Suspend the local tick device > + * > + * Called from the local cpu for freeze with interrupts disabled. > + * > + * No locks required. Nothing can change the per cpu device. > + */ > +void tick_suspend_local(void) > +{ > + struct tick_device *td = this_cpu_ptr(&tick_cpu_device); > + > + clockevents_shutdown(td->evtdev); > +} > + > +/** > * tick_suspend - Suspend the tick and the broadcast device > * > * Called from syscore_suspend() via timekeeping_suspend with only one > @@ -379,9 +393,7 @@ void tick_shutdown_local(void) > */ > void tick_suspend(void) > { > - struct tick_device *td = this_cpu_ptr(&tick_cpu_device); > - > - clockevents_shutdown(td->evtdev); > + tick_suspend_local(); > tick_suspend_broadcast(); > } > > > > -- > 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/ >