On Tue, 30 Apr 2019 10:18:37 +0100
Peter Maydell <peter.mayd...@linaro.org> wrote:

> On Tue, 30 Apr 2019 at 09:52, Like Xu <like...@linux.intel.com> wrote:
> >
> > If "smp_cpus> FSL_IMX6_NUM_CPUS" fails in *_realize(), there is no need to
> > initialize the CPUs in *_init(). So it could be better to create all cpus
> > after the validity in *_realize(). On the other hand, it makes the usages
> > of global variable smp_cpus more centrally for maintenance.
> 
> I'm not a great fan of this. I think that where possible
> we should init child objects in the parent's init
> function, and realize them in the realize function.
> There are a few cases where we're forced to do the
> child init in realize, but this doesn't seem like one of them.

well, if it were unconditional then initializing children in initfn would
be fine, however here number of children to initialize depends on global
smp_cpus. In order to get rid of global, we could move iniialization to realize
time or init all FSL_IMX6_NUM_CPUS and realize only smp_cpus at realize time.

> 
> thanks
> -- PMM


Reply via email to