[Skiboot] [PATCH 1/2] SLW: Disable deep state on p9_stop_api failure

Akshay Adiga akshay.adiga at linux.vnet.ibm.com
Thu Nov 16 14:19:35 AEDT 2017


Adds a per chip flag that needs to be set on stop api failure, at any
point before device-tree is created. If this flag is set, deeper states
(which use p9_stop_api) will not appear in device-tree.

Signed-off-by: Akshay Adiga <akshay.adiga at linux.vnet.ibm.com>
---
 hw/slw.c       | 11 ++++++++++-
 include/chip.h |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/hw/slw.c b/hw/slw.c
index c2c755d..02e938f 100644
--- a/hw/slw.c
+++ b/hw/slw.c
@@ -912,8 +912,14 @@ void add_cpu_idle_state_properties(void)
 	 * P9 : homer_base is set
 	 */
 	if (!(proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)) {
-		if (proc_gen == proc_gen_p9)
+		if (proc_gen == proc_gen_p9) {
+			struct proc_chip *c;
 			has_wakeup_engine = !!(chip->homer_base);
+			/* disable if p9_stop_api fails at any previous case */
+			for_each_chip(c) {
+				has_wakeup_engine &= ~(c->wakeup_engine_error);
+			}
+		}
 		else /* (proc_gen == proc_gen_p8) */
 			has_wakeup_engine = (chip->slw_base && chip->slw_bar_size &&
 					chip->slw_image_size);
@@ -1298,6 +1304,9 @@ static void slw_init_chip_p9(struct proc_chip *chip)
 			log_simple_error(&e_info(OPAL_RC_SLW_REG),
 				 "SLW: Failed to set HRMOR for CPU %x,RC=0x%x\n",
 				 c->pir, rc);
+			prlog(PR_ERR, "Disabling deep stop states\n");
+			chip->wakeup_engine_error = true;
+
 		}
 	}
 }
diff --git a/include/chip.h b/include/chip.h
index 566edc5..9a2f8bf 100644
--- a/include/chip.h
+++ b/include/chip.h
@@ -186,6 +186,7 @@ struct proc_chip {
 	uint64_t		slw_base;
 	uint64_t		slw_bar_size;
 	uint64_t		slw_image_size;
+	bool			wakeup_engine_error;
 
 	/* Used by hw/homer.c */
 	uint64_t		homer_base;
-- 
2.5.5



More information about the Skiboot mailing list