[PATCH 1/3] ARM: OMAP2+: 32k-counter: Use hwmod lookup to check presence of 32k timer

Hiremath, Vaibhav hvaibhav at ti.com
Fri Mar 30 02:39:26 EDT 2012


On Fri, Mar 23, 2012 at 13:50:25, Ming Lei wrote:
> On Wed, Mar 21, 2012 at 7:29 PM, Hiremath, Vaibhav <hvaibhav at ti.com> wrote:
> > On Mon, Mar 19, 2012 at 17:14:30, Ming Lei wrote:
> >> On Mon, Mar 19, 2012 at 7:11 PM, Hiremath, Vaibhav <hvaibhav at ti.com> wrote:
> >> >
> >> > I think you made very good point here. With the above patch, we are almost missing the capability of registering dmtimer as a clocksource for OMAP.
> >> > It will always use 32k-counter, and never fall back to dmtimer.
> >> >
> >> > Then the only options we have here is,
> >> >
> >> > 1) Register both the timers, 32k-counter and dmtimer for clocksource; let
> >> >   Kernel pick up best rating clocksource out of these two.
> >> >
> >> >   In case of OMAP1/2/3/4, kernel will use dmtimer, since it has better
> >> >   Rating. User can choose the 32k-counter clocksource via bootargs.
> >> >
> >> >   Impact: without bootargs for clocksource selection, kernel will choose
> >> >     dmtimer, impacting loss of time during suspend/resume.
> >> >
> >> >
> >> > 2) Let the current code be as is, means, the clocksource registration will
> >> >   Happened based on "#ifdef CONFIG_OMAP_32K_TIMER" and this option
> >> >   selection will be Controlled by Kconfig rules.
> >>
> >> How about the 3rd option?
> >>
> >> 3), take the way in your patch 1) at default, but will switch to
> >> register dmtimer
> >> directly and bypass 32k-counter if user need it via kernel parameter.
> >>
> >> As far as I can think of, the situations required for dmtimer are high-frequency
> >> perf sample and high precision trace points, so looks it is OK to take
> >> 32k-counter
> >> at default.
> >>
> > But if you register both the timers (dmtimer & 32ksync), then initially kernel will only pick up dmtimer, as this has better rating. And late in
> 
> Looks not so, I found that 32ksync is always selected as the default
> clocksource if both are registered.
> 

No. Kernel always chooses better-rated timer/counter for clocksource.
Please refer to the file 

"kernel/time/clocksource.c"

When you register any clocksource, the sequence is
	...
	clocksource_enqueue(cs);
	...
	clocksource_select();
	...

And clocksource_enqueue(), makes sure that the list of registered clocksource is always sorted by its rating. And clocksource_select()
Chooses best (first in the list) as a clocksource, unless you override
It using bootparams or sysfs.

Thanks,
Vaibhav

> > the boot sequence clocksource switch will happen, base on
> > kernel parameter (clocksource=).
> >
> > So logically dmtimer will be always used as a default here.
> 
> Not so at least on my Pandaboard.
> 
> 
> Thanks,
> -- 
> Ming Lei
> 




More information about the linux-arm-kernel mailing list