[Cbe-oss-dev] [PATCH] cell: move SPU affinity init code to a separate file

Arnd Bergmann arnd at arndb.de
Mon Jul 30 05:34:55 EST 2007


On Friday 27 July 2007, Benjamin Herrenschmidt wrote:
> > > +static int init_spu_affinity(void)
> > > +{
> > > +   if (of_has_vicinity()) {
> > > +           init_aff_fw_vicinity();
> > > +   } else {
> > > +           long root = of_get_flat_dt_root();
> > > +           if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
> > > +                   init_aff_QS20_harcoded();
> > > +   }
> > > +
> > > +   return 0;
> > > +}
> > > +
> > > +module_init(init_spu_affinity);
> > 
> > 
> > There is nothing here to prevent this code from executing
> > on the PS3.  module_init() will unconditionaly run
> > init_spu_affinity() for all platforms.  PS3 has no OF, and
> > when this code runs it will most likely fault.  Even if it
> > does run, it won't be doing the correct thing.
> 
> In fact, it may even do damage on !cell no ?
> 

I would guess not, because if any other platform has vicinity properties
(which is rather unlikely), the executing init_aff_fw_vicinity() should
not have any negative impact, and otherwise it is guaranteed not to
be compatible with "IBM,CPBW-1.0", so the initcall will not do anything.

	Arnd <><



More information about the cbe-oss-dev mailing list