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

Arnd Bergmann arnd at arndb.de
Mon Jul 30 17:39:34 EST 2007


On Monday 30 July 2007, Michael Ellerman wrote:
> 
> > 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.
> 
> But is of_has_vicinity() safe when the cbe_spu_infos have not been
> initialised?

Right, that is a bug. The same function also is broken if the first NUMA
node doesn't have an SPUs, and it returns an incorrect information if the
first SPU on the first node does not have a vicinity property but all the
other have one.

It should probably be something like

	of_for_each_node_by_type(dn, "spe") {
		if (of_find_property(dn, "vicinity", NULL))  {
			of_node_put(dn);
			return 1;
		}
	}
	return 0;



More information about the cbe-oss-dev mailing list