[Skiboot] [PATCH 2/2] xive: Use for_each_present_cpu() for setting up XIVE

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Dec 30 13:25:25 AEDT 2016


Otherwise, we try to access some XSCOMs on garded CPUs which
leads to all sorts of errors during boot.

Signed-off-by: Benjamin Herrenschmidt <benh at 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..9921250 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_present_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_present_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_present_cpu(cpu) {
 		xive_init_cpu(cpu);
 	}
 	/* Add interrupts propertie to each CPU node */
-	for_each_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		if (cpu_is_thread0(cpu))
 			xive_init_cpu_properties(cpu);
 	}




More information about the Skiboot mailing list