Re: Clock register in early init

From: Peter De Schrijver
Date: Tue May 22 2012 - 07:16:08 EST


On Mon, May 21, 2012 at 08:05:57PM +0200, Turquette, Mike wrote:
> On Mon, May 21, 2012 at 1:46 AM, Peter De Schrijver
> <pdeschrijver@xxxxxxxxxx> wrote:
> >>
> >> 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.
> >
>
> Is this really a problem? Once you have good data it does not change.
> Debugging bad data when introducing a new chip is just a fact of
> life. Static versus dynamic is irrelevant here.
>

I think it is a problem yes, especially when the tree becomes more
complicated.

Cheers,

Peter.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/