Re: Delays, clocks, timers, hrtimers, etc

Stephen Boyd <[email protected]> Wed, 11 Feb 2015 15:26:31 -0800
Newsgroups org.kernel.vger.cpufreq,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-pm
Message-ID <[email protected]>
On 02/11, Mason wrote:
> 
> Looking at the difference between OF and !OF registration functions
> in smp_twd.c
> 
> !OF
>   if (twd_base || twd_evt) return -EBUSY;
>   assign twd_ppi and twd_base
>   twd_local_timer_common_register(NULL)
> 
> OF
>   if (!is_smp() || !setup_max_cpus) return; // TO BE DELETED
>   assign twd_ppi and twd_base
>   twd_local_timer_common_register(np)
> 
> I suppose OF guarantees that the init code is called only once?

It's called as many times as there's a match with the
corresponding CLOCKSOURCE_OF_DECLARE. In practice that's once.

> (Hence the !OF guard code would be unnecessary.)
> 

The other difference is that OF based registration needs to use
OF functions for irqs and ioremap whereas the non-OF code relies
on the irqs being provided before hand and the ioremap done
without OF functions.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project