summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2018-04-27 15:02:29 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-04-29 19:51:33 -0500
commiteab215a0bc28dfbc05047b62180313ecdb72c24f (patch)
tree9285c6fb29d58ad4b9952d6d034f8f018b367677
parent3a0c57d0182911345aca784c19cce5095dbb0a09 (diff)
downloadtalos-skiboot-eab215a0bc28dfbc05047b62180313ecdb72c24f.tar.gz
talos-skiboot-eab215a0bc28dfbc05047b62180313ecdb72c24f.zip
hw/slw: Don't assert on a unknown chip
For some reason skiboot populates nodes in /cpus/ for the cores on chips that are deconfigured. As a result Linux includes the threads of those cores in it's set of possible CPUs in the system and attempts to set the SPR values that should be used when waking a thread from a deep sleep state. However, in the case where we have deconfigured chip we don't create a xscom node for that chip and as a result we don't have a proc_chip structure for that chip either. In turn, this results in an assertion failure when calling opal_slw_set_reg() since it expects the chip structure to exist. Fix this up and print an error instead. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--hw/slw.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/hw/slw.c b/hw/slw.c
index 3f9abaad..364f2f73 100644
--- a/hw/slw.c
+++ b/hw/slw.c
@@ -1511,9 +1511,17 @@ int64_t opal_slw_set_reg(uint64_t cpu_pir, uint64_t sprn, uint64_t val)
struct proc_chip *chip;
int rc;
- assert(c);
+ if (!c) {
+ prerror("SLW: Unknown thread with pir %x\n", (u32) cpu_pir);
+ return OPAL_PARAMETER;
+ }
+
chip = get_chip(c->chip_id);
- assert(chip);
+ if (!chip) {
+ prerror("SLW: Unknown chip for thread with pir %x\n",
+ (u32) cpu_pir);
+ return OPAL_PARAMETER;
+ }
if (proc_gen == proc_gen_p9) {
if (!has_deep_states) {
OpenPOWER on IntegriCloud