From patchwork Fri Feb 26 20:43:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vipin K Parashar X-Patchwork-Id: 589289 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A6918140325 for ; Sat, 27 Feb 2016 07:44:58 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 8BC651A0C6D for ; Sat, 27 Feb 2016 07:44:58 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 18D891A0034 for ; Sat, 27 Feb 2016 07:44:55 +1100 (AEDT) Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 27 Feb 2016 06:44:53 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 27 Feb 2016 06:44:52 +1000 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: vipin@linux.vnet.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 7DEBB2CE8046 for ; Sat, 27 Feb 2016 07:44:52 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1QKiiQA49283166 for ; Sat, 27 Feb 2016 07:44:52 +1100 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 u1QKiJ6Y019183 for ; Sat, 27 Feb 2016 07:44:19 +1100 Received: from Thinkpad420.in.ibm.com ([9.79.222.75]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u1QKiIxe018987; Sat, 27 Feb 2016 07:44:19 +1100 From: Vipin K Parashar To: skiboot@lists.ozlabs.org Date: Sat, 27 Feb 2016 02:13:26 +0530 Message-Id: <1456519406-10087-1-git-send-email-vipin@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16022620-0017-0000-0000-000002E50C2D Subject: [Skiboot] [PATCH] ipmi: Log exact NetFn value in OPAL logs X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" As per IPMI message format NetFn value in present in first 6 bits while last 2 bits contain LUN value. This needs to be taken care while printing NetFn value in OPAL logs which is useful while debugging fails. [root@fir01 /]# ipmitool raw 0x0a 0x48 47 b1 d0 56 [root@fir01 /]# From OPAL Logs --------------- [133969609199,7] BT: seq 0x3d netfn 0x0a cmd 0x48: Message sent to host [133975465455,7] BT: seq 0x3d netfn 0x0a cmd 0x48: IPMI MSG done From BMC Logs -------------- IPMIMain: [693 WARNING][corecmdselect.c:913] Request: Channel:f; Netfn:a; Cmd:48; IPMIMain: [693 INFO][corecmdselect.c:924] Response: Channel:f; Netfn:a; Cmd:48; Data:0 47 b1 d0 56 Signed-off-by: Vipin K Parashar Reviewed-by: Cyril Bur --- core/ipmi.c | 2 +- hw/bt.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/ipmi.c b/core/ipmi.c index 60e9640..6fdb9a7 100644 --- a/core/ipmi.c +++ b/core/ipmi.c @@ -141,7 +141,7 @@ void ipmi_cmd_done(uint8_t cmd, uint8_t netfn, uint8_t cc, struct ipmi_msg *msg) } if ((msg->netfn >> 2) + 1 != (netfn >> 2)) { - prerror("IPMI: Incorrect netfn 0x%02x in response\n", netfn); + prerror("IPMI: Incorrect netfn 0x%02x in response\n", netfn >> 2); cc = IPMI_ERR_UNSPECIFIED; } msg->netfn = netfn; diff --git a/hw/bt.c b/hw/bt.c index 3325f69..ca8bd1e 100644 --- a/hw/bt.c +++ b/hw/bt.c @@ -15,6 +15,7 @@ */ #define pr_fmt(fmt) "BT: " fmt + #include #include #include @@ -80,7 +81,7 @@ #define _BT_Q_LOG(level, msg, fmt, args...) \ do { if (msg) \ prlog(level, "seq 0x%02x netfn 0x%02x cmd 0x%02x: " fmt "\n", \ - (msg)->seq, (msg)->ipmi_msg.netfn, (msg)->ipmi_msg.cmd, ##args); \ + (msg)->seq, ((msg)->ipmi_msg.netfn >> 2), (msg)->ipmi_msg.cmd, ##args); \ else \ prlog(level, "seq 0x?? netfn 0x?? cmd 0x??: " fmt "\n", ##args); \ } while(0) @@ -346,7 +347,7 @@ static void bt_get_resp(void) if (!bt_msg) { /* A response to a message we no longer care about. */ prlog(PR_INFO, "Nobody cared about a response to an BT/IPMI message" - "(seq 0x%02x netfn 0x%02x cmd 0x%02x)\n", seq, netfn, cmd); + "(seq 0x%02x netfn 0x%02x cmd 0x%02x)\n", seq, (netfn >> 2), cmd); bt_flush_msg(); return; }