[PATCH]: PowerPC: make sure the rtas stop-self token is defined.

Linas Vepstas linas at austin.ibm.com
Sat Nov 11 12:01:08 EST 2006


On Fri, Nov 10, 2006 at 02:01:52PM -0600, Nathan Lynch wrote:
> Linas Vepstas wrote:
> > 
> > There are a variety of code paths that lead to rtas_stop_self()
> > being called, primarily through cpu_die(). However, rtas_stop_self() 
> > has a BUG_ON(rtas_args->token == RTAS_UNKNOWN_SERVICE); in it, and
> > this rtas token is only set up if CONFIG_HOTPLUG_CPU is defined.
> > 
> > Rather than wrapping all of the callers of rtas_stop_self()
> > with CONFIG_HOTPLUG_CPU, it seems wiser to just unwrap the token
> > definition.
> 
> Is there actually a code path that calls rtas_stop_self with
> CONFIG_HOTPLUG_CPU=n?  That would be a bug, I think.

Yeah, that was my first reaction too, right next to "user error". 
But then I started tracing the code paths, and after they multiplied
a bit, it was clear that the answer wouldn't be clear. 

So then I philosophized a bit: if the code cannot be called
unless CONFIG_HOTPLUG_CPU=y, then I should add #ifdef CONFIG_HOTPLUG_CPU
to make sure that the code doesn't even get compiled in.

Well, there used to be such ifdefs (according to Joel) but someone 
removed the ifdefs. I'm guessing that these got removed during the
powerpc tree migration.

So... Rather than wrapping all of the callers of rtas_stop_self() ...

--linas



More information about the Linuxppc-dev mailing list