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

Michael Ellerman michael at ellerman.id.au
Wed Jul 25 09:30:24 EST 2007


On Tue, 2007-07-24 at 11:48 -0700, Geoff Levand wrote:
> Andre Detsch wrote:
> > Subject: cell - move SPU affinity init code to a separate file
> > 
> > From: Andre Detsch <adetsch at br.ibm.com>
> > 
> > This patch moves affinity initialization code from spu_base.c to a
> > new spu_affinity.c file. This file is not compiled for PS3,
> > fixing a linking issue which was happening when compiling for this
> > platform.
> > 
> > SPU affinity initialization must be run _after_ spu_base.c
> > initialization. This is ensured through the order of the object files 
> > set in the Makefile.
> > 
> > Signed-off-by: Andre Detsch <adetsch at br.ibm.com>
> > 
> > +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.


Which is just one more reason why PS3 should have a device tree.

Still, I don't see that it's a problem. On PS3 spu->devnode should be
NULL, so of_has_vicinity() should return NULL - and then the compatible
check for CPBW will fail and so nothing will get initialised.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/cbe-oss-dev/attachments/20070725/e6328a10/attachment.pgp>


More information about the cbe-oss-dev mailing list