From a4c6f6e512eddd9be627e9e8d1009efacd3408b9 Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Tue, 10 Feb 2015 00:57:26 +0000 Subject: [PATCH] Add error reporting to interrupt CPU binding. --- sys/powerpc/pseries/xics.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/pseries/xics.c b/sys/powerpc/pseries/xics.c index f1a3c8b38c9a..2d012c5faa7b 100644 --- a/sys/powerpc/pseries/xics.c +++ b/sys/powerpc/pseries/xics.c @@ -197,12 +197,13 @@ xicp_bind(device_t dev, u_int irq, cpuset_t cpumask) { struct xicp_softc *sc = device_get_softc(dev); cell_t status, cpu; - int ncpus, i; + int ncpus, i, error; /* * This doesn't appear to actually support affinity groups, so pick a * random CPU. */ + ncpus = 0; CPU_FOREACH(cpu) if (CPU_ISSET(cpu, &cpumask)) ncpus++; @@ -217,8 +218,10 @@ xicp_bind(device_t dev, u_int irq, cpuset_t cpumask) } - rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, XICP_PRIORITY, - &status); + error = rtas_call_method(sc->ibm_set_xive, 3, 1, irq, cpu, + XICP_PRIORITY, &status); + if (error < 0) + panic("Cannot bind interrupt %d to CPU %d", irq, cpu); } static void