Clock register in early init

Peter De Schrijver pdeschrijver at nvidia.com
Mon May 21 04:46:42 EDT 2012


> 
> On OMAP I think the only "gotcha" is setting up the timer.  One
> solution is to open code the register reads and the rate calculation
> in the timer code.  That is ugly... but it works.
> 
> > Which advantages do you see in dynamically allocating all this?
> >
> 
> There are many but I'll name a couple.  The most significant point is
> that we can avoid exposing the definition of struct clk if we
> dynamically allocate stuff.  One can use struct clk_hw_init to
> statically initialize data, or instead rely on direct calls to
> clk_register with a bunch of parameters.
> 

Which means if you make a mistake in specifying parents for example, it will
only fail at runtime, possibly before any console is active. With static
initialization, this will fail at compiletime. Much easier to debug.

> Another point is that copying the data at registration-time makes
> __initdata possible.  I haven't done the math yet to see if this
> really makes a difference.  However if we start doing single zImage's
> with multiple different ARM SoCs then this could recover some pages.
> 

On the other hand most clock structures are small, so there will be internal
fragmentation. Also the arrays of parent clock pointers can be shared between
different clocks. We have about 70 muxes in Tegra30 and 12 different parent
arrays.

Cheers,

Peter.



More information about the linux-arm-kernel mailing list