Message ID | 1482989214.13332.7.camel@kernel.crashing.org |
---|---|
State | Superseded |
Headers | show |
On Thu, 2016-12-29 at 16:26 +1100, Benjamin Herrenschmidt wrote: > Don't use for_each_cpu() otherwise we try to access CPUs > that haven't been enabled by cronus/hostboot and nasty > errors ensure. Ignore, that won't work... cooking a better one. CPU aren't "available" until they are called in and that is called before that. > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> > --- > hw/xive.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/hw/xive.c b/hw/xive.c > index b5f2af8..29d9f76 100644 > --- a/hw/xive.c > +++ b/hw/xive.c > @@ -3629,7 +3629,7 @@ static void xive_reset_one(struct xive *x) > } > > /* Take out all VPs from HW and reset all CPPRs to 0 */ > - for_each_cpu(c) { > + for_each_available_cpu(c) { > if (c->chip_id != x->chip_id) > continue; > if (!c->xstate) > @@ -3672,7 +3672,7 @@ static void xive_reset_one(struct xive *x) > #endif > > /* Re-configure the CPUs */ > - for_each_cpu(c) { > + for_each_available_cpu(c) { > struct xive_cpu_state *xs = c->xstate; > > if (c->chip_id != x->chip_id || !xs) > @@ -4004,11 +4004,11 @@ void init_xive(void) > } > > /* Initialize XICS emulation per-cpu structures */ > - for_each_cpu(cpu) { > + for_each_available_cpu(cpu) { > xive_init_cpu(cpu); > } > /* Add interrupts propertie to each CPU node */ > - for_each_cpu(cpu) { > + for_each_available_cpu(cpu) { > if (cpu_is_thread0(cpu)) > xive_init_cpu_properties(cpu); > }
diff --git a/hw/xive.c b/hw/xive.c index b5f2af8..29d9f76 100644 --- a/hw/xive.c +++ b/hw/xive.c @@ -3629,7 +3629,7 @@ static void xive_reset_one(struct xive *x) } /* Take out all VPs from HW and reset all CPPRs to 0 */ - for_each_cpu(c) { + for_each_available_cpu(c) { if (c->chip_id != x->chip_id) continue; if (!c->xstate) @@ -3672,7 +3672,7 @@ static void xive_reset_one(struct xive *x) #endif /* Re-configure the CPUs */ - for_each_cpu(c) { + for_each_available_cpu(c) { struct xive_cpu_state *xs = c->xstate; if (c->chip_id != x->chip_id || !xs) @@ -4004,11 +4004,11 @@ void init_xive(void) } /* Initialize XICS emulation per-cpu structures */ - for_each_cpu(cpu) { + for_each_available_cpu(cpu) { xive_init_cpu(cpu); } /* Add interrupts propertie to each CPU node */ - for_each_cpu(cpu) { + for_each_available_cpu(cpu) { if (cpu_is_thread0(cpu)) xive_init_cpu_properties(cpu); }
Don't use for_each_cpu() otherwise we try to access CPUs that haven't been enabled by cronus/hostboot and nasty errors ensure. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> --- hw/xive.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)