From patchwork Fri Sep 4 11:25:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 514386 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 71DA41402A3 for ; Fri, 4 Sep 2015 21:26:39 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 56AC61A1E5A for ; Fri, 4 Sep 2015 21:26:39 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 10AEE1A18BC for ; Fri, 4 Sep 2015 21:26:24 +1000 (AEST) Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 4 Sep 2015 21:26:21 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 4 Sep 2015 21:26:19 +1000 X-Helo: d23dlp01.au.ibm.com X-MailFrom: hegdevasant@linux.vnet.ibm.com X-RcptTo: skiboot@lists.ozlabs.org Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 844552CE8052 for ; Fri, 4 Sep 2015 21:26:18 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t84BQAPm60162294 for ; Fri, 4 Sep 2015 21:26:18 +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 t84BPjDN031081 for ; Fri, 4 Sep 2015 21:25:45 +1000 Received: from hegdevasant.in.ibm.com (hegdevasant.in.ibm.com [9.124.158.62]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t84BPhYh030706; Fri, 4 Sep 2015 21:25:44 +1000 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Fri, 4 Sep 2015 16:55:06 +0530 Message-Id: <1441365913-30214-2-git-send-email-hegdevasant@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1441365913-30214-1-git-send-email-hegdevasant@linux.vnet.ibm.com> References: <1441365913-30214-1-git-send-email-hegdevasant@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15090411-0029-0000-0000-0000021F9930 Subject: [Skiboot] [PATCH v2 1/8] IPMI: Fix corner case eSEL logging issue 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" eSEL logging fails, if eSEL event size is multiples of IPMI buffer size. Signed-off-by: Vasant Hegde --- Stewart, Accidently I happened to log event with PEL log size = 0x2e6. Then I observed this bug. -Vasant --- hw/ipmi/ipmi-sel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c index 343ca02..d711a1a 100644 --- a/hw/ipmi/ipmi-sel.c +++ b/hw/ipmi/ipmi-sel.c @@ -312,7 +312,7 @@ static void ipmi_elog_poll(struct ipmi_msg *msg) return; } - if ((esel_size - esel_index) < (IPMI_MAX_REQ_SIZE - ESEL_HDR_SIZE)) { + if ((esel_size - esel_index) <= (IPMI_MAX_REQ_SIZE - ESEL_HDR_SIZE)) { /* Last data to send */ msg->data[6] = 1; req_size = esel_size - esel_index + ESEL_HDR_SIZE;