[Skiboot] [PATCH] fast-boot: occ: Re-parse the pstate table during fast-boot
Shilpasri G Bhat
shilpa.bhat at linux.vnet.ibm.com
Fri Feb 2 18:02:32 AEDT 2018
OCC shares the frequency list to host by copying the pstate table to
main memory in HOMER. This table is parsed during boot to create
device-tree properties for frequency and pstate IDs. OCC can update
the pstate table to present a new set of frequencies to the host. But
host will remain oblivious to these changes unless it is re-inited
with the updated device-tree CPU frequency properties. So this patch
allows to re-parse the pstate table and update the device-tree
properties during fast-reboot.
OCC updates the pstate table when asked to do so using pstate-table
bias command. And this is mainly used by WOF team for
characterization purposes.
Signed-off-by: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
Tested-by: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com>
---
core/init.c | 3 ++-
hw/occ.c | 23 +++++++++++++++++++++--
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/core/init.c b/core/init.c
index ec9f329..92c79af 100644
--- a/core/init.c
+++ b/core/init.c
@@ -486,6 +486,8 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
ipmi_set_fw_progress_sensor(IPMI_FW_OS_BOOT);
+ occ_pstates_init();
+
if (!is_reboot) {
/* We wait for the nvram read to complete here so we can
* grab stuff from there such as the kernel arguments
@@ -499,7 +501,6 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
* OCC takes few secs to boot. Call this as late as
* as possible to avoid delay.
*/
- occ_pstates_init();
occ_sensors_init();
} else {
diff --git a/hw/occ.c b/hw/occ.c
index f3f1231..fb7e683 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -1556,8 +1556,24 @@ void occ_pstates_init(void)
if (proc_gen < proc_gen_p8)
return;
/* Handle fast reboots */
- if (occ_pstates_initialized)
- return;
+ if (occ_pstates_initialized) {
+ struct dt_node *power_mgt;
+ int i;
+ const char *props[] = {
+ "ibm,pstate-core-max",
+ "ibm,pstate-frequencies-mhz",
+ "ibm,pstate-ids",
+ "ibm,pstate-max",
+ "ibm,pstate-min",
+ "ibm,pstate-nominal",
+ "ibm,pstate-turbo",
+ "ibm,pstate-ultra-turbo",
+ };
+
+ power_mgt = dt_find_by_path(dt_root, "/ibm,opal/power-mgt");
+ for (i = 0; i < ARRAY_SIZE(props); i++)
+ dt_check_del_prop(power_mgt, props[i]);
+ }
switch (proc_gen) {
case proc_gen_p8:
@@ -1605,6 +1621,9 @@ void occ_pstates_init(void)
cpu_pstates_prepare_core(chip, c, pstate_nom);
}
+ if (occ_pstates_initialized)
+ return;
+
/* Add opal_poller to poll OCC throttle status of each chip */
for_each_chip(chip)
chip->throttle = 0;
--
1.8.3.1
More information about the Skiboot
mailing list