[Skiboot] [PATCH 2/2] opal-prd: Fix opal-prd command line options

Daniel M Crowell dcrowell at us.ibm.com
Sat Sep 23 12:58:44 AEST 2017


Seems right to me

--
Dan Crowell
Senior Software Engineer - Power Systems Enablement Firmware
IBM Rochester: t/l 553-2987
dcrowell at us.ibm.com



From:   Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
To:     skiboot at lists.ozlabs.org
Cc:     Vasant Hegde <hegdevasant at linux.vnet.ibm.com>, Jeremy Kerr 
<jk at ozlabs.org>, Daniel M Crowell/Rochester/IBM at IBMUS
Date:   09/21/2017 09:20 AM
Subject:        [PATCH 2/2] opal-prd: Fix opal-prd command line options



HBRT OCC reset interface depends on service processor type.
  FSP -> reset_pm_complex()
  BMC -> process_occ_reset()

We have both `occ` and `pm-complex` command line interfaces.
This patch adds support to dispaly appropriate message depending
on system type.
  FSP -> opal-prd occ         --> display error message
  FSP -> opal-prd pm-complex  --> Call pm_complex_reset()
  BMC -> opal-prd occ         --> Call process_occ_reset()
  BMC -> opal-prd pm-complex  --> display error message

CC: Jeremy Kerr <jk at ozlabs.org>
CC: Daniel M Crowell <dcrowell at us.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 external/opal-prd/opal-prd.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index 20ce5da..c26cc95 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -1584,7 +1584,7 @@ static void handle_prd_control_occ_reset(struct 
control_msg *send_msg,
                 chip = msg->occ_reset.chip;
 
                 /* do reset */
-                pr_debug("CTRL: resetting PM complex on chip %ld", chip);
+                pr_debug("CTRL: Calling OCC reset on chip %ld", chip);
                 pm_complex_reset(chip);
 
                 send_msg->data_len = 0;
@@ -2326,9 +2326,24 @@ static int parse_action(const char *str, enum 
action *action)
 {
                 int rc;
 
-                if (!strcmp(str, "occ") || !strcmp(str, "pm-complex")) {
+                if (!strcmp(str, "occ")) {
                                 *action = ACTION_OCC_CONTROL;
                                 rc = 0;
+
+                                if (is_fsp_system()) {
+                                                pr_log(LOG_ERR, "CTRL: 
occ commands are not "
+                                                       "supported on this 
system");
+                                                rc = -1;
+                                }
+                } else if (!strcmp(str, "pm-complex")) {
+                                *action = ACTION_OCC_CONTROL;
+                                rc = 0;
+
+                                if (!is_fsp_system()) {
+                                                pr_log(LOG_ERR, "CTRL: 
pm-complex commands are not "
+                                                       "supported on this 
system");
+                                                rc = -1;
+                                }
                 } else if (!strcmp(str, "daemon")) {
                                 *action = ACTION_RUN_DAEMON;
                                 rc = 0;
-- 
2.9.3





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/skiboot/attachments/20170922/244931df/attachment.html>


More information about the Skiboot mailing list