From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grygorii Strashko Subject: Re: [PATCH 1/2] ARM: OMAP2+: Initialize timers later with late_time_init Date: Tue, 1 Dec 2015 15:52:09 +0200 Message-ID: <565DA609.2020204@ti.com> References: <1448900789-4034-1-git-send-email-tony@atomide.com> <1448900789-4034-2-git-send-email-tony@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1448900789-4034-2-git-send-email-tony@atomide.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Tony Lindgren , linux-omap@vger.kernel.org Cc: Tero Kristo , Paul Walmsley , Felipe Balbi , linux-arm-kernel@lists.infradead.org List-Id: linux-omap@vger.kernel.org On 11/30/2015 06:26 PM, Tony Lindgren wrote: > We don't need timers right away and initializing them later gives us few > nice things like interrupts and kmalloc. As the timers have a dependency > to the clock framework, we're better off initializing things later rather > than early if things go wrong. And this allows us to make the mux clock > driver needed for system timers into early_platform drivers. > > Note that smp_prepare_cpus() will get called later on during the init so > we just need to local_irq_enable/disable for clocksource_probe(). > > Cc: Felipe Balbi > Cc: Grygorii Strashko > Cc: Paul Walmsley > Cc: Tero Kristo > Signed-off-by: Tony Lindgren > --- > arch/arm/mach-omap2/timer.c | 46 +++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 40 insertions(+), 6 deletions(-) > > diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c > index b18ebbe..68bf482 100644 > --- a/arch/arm/mach-omap2/timer.c > +++ b/arch/arm/mach-omap2/timer.c > @@ -478,36 +478,56 @@ static void __init __omap_sync32k_timer_init(int clkev_nr, const char *clkev_src > omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop); > > /* Enable the use of clocksource="gp_timer" kernel parameter */ > + local_irq_disable(); > if (use_gptimer_clksrc || gptimer) > omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src, > clksrc_prop); > else > omap2_sync32k_clocksource_init(); > + local_irq_enable(); So, this will be called now after sched_clock_postinit() and to W/A warnings you've added local_irq_disable()/local_irq_enable(). Am I right? Are you sure this is safe? -- regards, -grygorii From mboxrd@z Thu Jan 1 00:00:00 1970 From: grygorii.strashko@ti.com (Grygorii Strashko) Date: Tue, 1 Dec 2015 15:52:09 +0200 Subject: [PATCH 1/2] ARM: OMAP2+: Initialize timers later with late_time_init In-Reply-To: <1448900789-4034-2-git-send-email-tony@atomide.com> References: <1448900789-4034-1-git-send-email-tony@atomide.com> <1448900789-4034-2-git-send-email-tony@atomide.com> Message-ID: <565DA609.2020204@ti.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 11/30/2015 06:26 PM, Tony Lindgren wrote: > We don't need timers right away and initializing them later gives us few > nice things like interrupts and kmalloc. As the timers have a dependency > to the clock framework, we're better off initializing things later rather > than early if things go wrong. And this allows us to make the mux clock > driver needed for system timers into early_platform drivers. > > Note that smp_prepare_cpus() will get called later on during the init so > we just need to local_irq_enable/disable for clocksource_probe(). > > Cc: Felipe Balbi > Cc: Grygorii Strashko > Cc: Paul Walmsley > Cc: Tero Kristo > Signed-off-by: Tony Lindgren > --- > arch/arm/mach-omap2/timer.c | 46 +++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 40 insertions(+), 6 deletions(-) > > diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c > index b18ebbe..68bf482 100644 > --- a/arch/arm/mach-omap2/timer.c > +++ b/arch/arm/mach-omap2/timer.c > @@ -478,36 +478,56 @@ static void __init __omap_sync32k_timer_init(int clkev_nr, const char *clkev_src > omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop); > > /* Enable the use of clocksource="gp_timer" kernel parameter */ > + local_irq_disable(); > if (use_gptimer_clksrc || gptimer) > omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src, > clksrc_prop); > else > omap2_sync32k_clocksource_init(); > + local_irq_enable(); So, this will be called now after sched_clock_postinit() and to W/A warnings you've added local_irq_disable()/local_irq_enable(). Am I right? Are you sure this is safe? -- regards, -grygorii