Subject: Re: function calls from identify_cpu()

From: Kevin Diggs <[email-masked]>
Date: Fri, 02 May 2008 22:45:26 -0700

Benjamin Herrenschmidt wrote:
> On Fri, 2008-05-02 at 13:42 -0700, Kevin Diggs wrote:
> 
>>I added:
>>
>>int __init iDoNothingUseful(struct cpu_spec *s,struct cpu_spec *t)
>>{
>>         return s-t;
>>}
>>
>>right before the definition of identify_cpu() in cputable.c and:
>>
>>//                      (void) (*PTRRELOC(&iDoNothingUseful))(s,t);
>>                         (void) iDoNothingUseful(s,t);
>>
>>right before the return s; in the match block and it will not boot? Can 
>>someone please explain what might be going on?
> 
> 
> Why are you trying to muck around with that code in the first
> place ? :-)
> 
> What are you trying to achieve ?
> 
> Cheers,
> Ben.
> 
The original intent was to find a way to add some of the PLL parameters 
(min and max core frequencies, min and max bus ratios - FX 400 - 800, 2 
- 20; GX 500 - 1000, 2 - 20). Initially it seemed like the place to put 
them. To avoid kernel bloat I think I'll just put them in the init 
routine of the driver. I'll have to redo the cpu detection (FX vs GX); 
but I guess that is not that big of a deal.

But now it is about retaining what is left of my sanity. I took the 
above code and added it to a GigE running the same installation (the 
8600 installation was created by installing its disk in the GigE) and it 
ran fine!?! ANY suggestions would be greatly appreciated. Something to 
do with BootX? BootX is to old (1.2.4)? System needs an exorcism? I 
screwed up something in the 750GX cpu_spec entry?

Both are running 2.6.24.

kevin

P.S.:  I would still appreciate it if someone could explain why this line:

*PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;

isn't:

*PTRRELOC((&cur_cpu_spec) = PTRRELOC(&the_cpu_spec);

Is the address &the_cpu_spec valid later in the kernel initialization? 
Is it ... valid now?