From patchwork Thu Sep 21 14:19:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 816887 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xyf0Z5XF9z9s06 for ; Fri, 22 Sep 2017 00:20:46 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xyf0Z2Kg1zDr5Q for ; Fri, 22 Sep 2017 00:20:46 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=hegdevasant@linux.vnet.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xyf0B3J9ZzDqT0 for ; Fri, 22 Sep 2017 00:20:26 +1000 (AEST) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8LEIiBd103422 for ; Thu, 21 Sep 2017 10:20:23 -0400 Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) by mx0b-001b2d01.pphosted.com with ESMTP id 2d4bk057kw-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 21 Sep 2017 10:20:22 -0400 Received: from localhost by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Sep 2017 00:20:16 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 22 Sep 2017 00:20:14 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8LEKE7S42270968 for ; Fri, 22 Sep 2017 00:20:14 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v8LEKEHq001172 for ; Fri, 22 Sep 2017 00:20:14 +1000 Received: from hegdevasant.in.ibm.com ([9.79.212.119]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v8LEK8Mr000638; Fri, 22 Sep 2017 00:20:12 +1000 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Thu, 21 Sep 2017 19:49:48 +0530 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170921141948.27168-1-hegdevasant@linux.vnet.ibm.com> References: <20170921141948.27168-1-hegdevasant@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17092114-0004-0000-0000-0000022F764E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17092114-0005-0000-0000-00005E18ED66 Message-Id: <20170921141948.27168-2-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-21_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709210190 Subject: [Skiboot] [PATCH 2/2] opal-prd: Fix opal-prd command line options X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel M Crowell MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 CC: Daniel M Crowell Signed-off-by: Vasant Hegde Signed-off-by: Vasant Hegde --- 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;