[U-Boot] [PATCH] ppc: transform init_sequence into a function.

Joakim Tjernlund joakim.tjernlund at transmode.se
Tue Dec 7 10:08:56 CET 2010


Wolfgang Denk <wd at denx.de> wrote on 2010/12/07 07:34:49:
>
> Dear Joakim Tjernlund,
>
> In message <OF9FF97B1B.1FC2BD05-ONC12577F2.0000D034-C12577F2.0002F125 at transmode.se> you wrote:
> >
> > > > though the loop is cumbersome and not easy as BDI tends to
> > > > flush the cache when it stops so you loose your stack.
> > >
> > > Does it? On which architecture / processor is this?
> >
> > MPC8321 and BDI2000. I have to play games with some internal
> > BDI command called SAP. Maybe they have fixed this in later models?
>
> Are you using the latest firmware, i. . 1.31 from October 2009?

No, got an earlier one, 1.24

>
> > > ...but ugly to read.  And if you really want to introduce this style,
> > > it has to be done for all architectures, as I want to see this code to
> > > become common across architectures.
> >
> > That is the next issue, lets not stray from the path ..
>
> Right, that's the next issue, lets not stray from the path and put
> additional road blocks into our way when we already know where we are
> heading to.

hmm, not sure how to read this. Irony? I was not trying to dodge
the subject, just wanted to keep the discussion focused. Of course
this can be adapted on all archs.

>
> > > I haven't, lately, that's true, or when I had, I always knew pretty
> > > well where I had to expect the issues.  But I've been there before,
> > > many, many times.
> >
> > And you never found it annoying when you hit these function ptrs?
>
> Actually, no.
>
> In an earlier life I've been programming in Forth for some time, so I
> find a list of addresses to process quite natural and efficient.
>
> > Now you are proposing that I instrument the code, much like Scott and his
> > print of address idea. This is exactly what I want to avoid as it would
> > probably have to be adapted from case to case and there is always the
> > case when there is no output and then I am back to square zero again.
>
> Don't you use oneliners in the shell that you just make up as needed
> and then throw away, and reinvent when you need them again?
>
> Same here. Adding a printf() or similar to some code under test is
> something I do several times a day. Even when running under a
> debugger, and even when I'm not executing a list of function pointers.
> I see no issue with adding this on a case-by-case base, had-tailored
> to the specific problem I'm tracking down.

Yes, this is a useful technique but it costs time. You don't
add these printout unless you need them, right? This is my
point. If you move to pure function calls you don't have to add
them just to identify what function crashes or lookup addresses etc.
Just move a BPs around without recompiling and reloading the code.

>
> > The argument that it is uglier alone is not a very good one.
> > Image the roles were reversed, I am sure you would dismiss me as
> > "less beautiful" is really not an argument alone.
>
> Ugliness was only one of several arguments, and there were several
> votes againt yours.

There was votes against with false claims that is is just as easy
to debug function ptrs.
And there was Scott which one day hope to have "real section-list initfuncs"
Bottom line argument is that the new code is uglier and that trumps
any of my arguments.

>
> Please consider the case closed.  I already marked the patch as NAKed.

I see, thanks for your time.

 Jocke



More information about the U-Boot mailing list