[PATCH 1/5] ARM: OMAP2+: Display correct system timer name

Bedia, Vaibhav vaibhav.bedia at ti.com
Fri Feb 1 04:31:04 EST 2013


On Fri, Feb 01, 2013 at 14:23:43, Hunter, Jon wrote:
[...]
> >>  
> >> +/* Timer name needs to be big enough to store a string of "timerXX" */
> >> +static char timer_name[10];
> >> +
> > 
> > Why not move this inside omap_dm_timer_init_one()?
> 
> In the non-DT case, the name member of the clocksource/event struct will
> point to this array and so it needs to reside in memory permanently and
> not just temporary. Once we migrate completely to DT then we will be
> able to remove this completely. See following snippet ...
> 
> -		sprintf(name, "timer%d", gptimer_id);
> -		oh_name = name;
> +		sprintf(timer_name, "timer%d", gptimer_id);
> +		*name = timer_name;

Ok. But in case of non-DT boot if someone selects gptimers for both clkevt and
clksrc, both the name members will end up pointing to the same memory location.
To be specific, in the current code the clkevt timer name will point to the clksrc
name. This won't be noticeable during boot since the clkevt name gets printed
before it is over-written.

Regards,
Vaibhav



More information about the linux-arm-kernel mailing list