From nobody@FreeBSD.org  Tue Oct 19 21:40:09 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9CF0410656A7
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Oct 2010 21:40:09 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 87E068FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Oct 2010 21:40:09 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o9JLe81W068959
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 19 Oct 2010 21:40:08 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o9JLe8ta068947;
	Tue, 19 Oct 2010 21:40:08 GMT
	(envelope-from nobody)
Message-Id: <201010192140.o9JLe8ta068947@www.freebsd.org>
Date: Tue, 19 Oct 2010 21:40:08 GMT
From: Andrew Boyer <aboyer@averesystems.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] [ipmi] Incorrect firmware version printed at boot time
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         151586
>Category:       kern
>Synopsis:       [patch] [ipmi] Incorrect firmware version printed at boot time
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 19 21:50:07 UTC 2010
>Closed-Date:    Tue Apr 19 07:45:30 UTC 2011
>Last-Modified:  Tue Apr 19 07:50:11 UTC 2011
>Originator:     Andrew Boyer
>Release:        head
>Organization:
Avere Systems
>Environment:
N/A
>Description:
The ipmi driver prints out some status information when the driver loads:
ipmi0: <IPMI System Interface> on isa0
ipmi0: KCS mode found at io 0xca2 alignment 0x1 on isa
ipmi0: IPMI device rev. 1, firmware rev. 1.2, version 2.0
ipmi0: Number of channels 8

I noticed that the 'firmware rev' is not correct.  In this case, the rev should be 1.60 (hex) or 1.96 (dec).

The wrong byte is used in the printf statement.  See IPMI 2.0 spec 1.0 Table 20-2 on page 240.
>How-To-Repeat:
Compare the printed firmware rev to the installed firmware.
>Fix:
--- a/src/sys/dev/ipmi/ipmi.c
+++ b/src/sys/dev/ipmi/ipmi.c
@@ -726,7 +726,7 @@ ipmi_startup(void *arg)
        device_printf(dev, "IPMI device rev. %d, firmware rev. %d.%d, "
            "version %d.%d\n",
             req->ir_reply[1] & 0x0f,
-            req->ir_reply[2] & 0x0f, req->ir_reply[4],
+            req->ir_reply[2] & 0x0f, req->ir_reply[3],
             req->ir_reply[4] & 0x0f, req->ir_reply[4] >> 4);
 
        ipmi_free_request(req);


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: ru 
State-Changed-When: Thu Apr 14 07:14:32 UTC 2011 
State-Changed-Why:  
Fixed in 9.0-CURRENT. 


Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: ru 
Responsible-Changed-When: Thu Apr 14 07:14:32 UTC 2011 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=151586 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/151586: commit references a PR
Date: Thu, 14 Apr 2011 07:14:33 +0000 (UTC)

 Author: ru
 Date: Thu Apr 14 07:14:22 2011
 New Revision: 220614
 URL: http://svn.freebsd.org/changeset/base/220614
 
 Log:
   Fixed firmware revision decoding:
   - the major is 7-bit binary encoded
   - the minor is BCD encoded
   
   PR:		kern/151586
   MFC after:	3 days
 
 Modified:
   head/sys/dev/ipmi/ipmi.c
 
 Modified: head/sys/dev/ipmi/ipmi.c
 ==============================================================================
 --- head/sys/dev/ipmi/ipmi.c	Thu Apr 14 00:07:08 2011	(r220613)
 +++ head/sys/dev/ipmi/ipmi.c	Thu Apr 14 07:14:22 2011	(r220614)
 @@ -713,10 +713,10 @@ ipmi_startup(void *arg)
  		return;
  	}
  
 -	device_printf(dev, "IPMI device rev. %d, firmware rev. %d.%d, "
 +	device_printf(dev, "IPMI device rev. %d, firmware rev. %d.%d%d, "
  	    "version %d.%d\n",
  	     req->ir_reply[1] & 0x0f,
 -	     req->ir_reply[2] & 0x0f, req->ir_reply[4],
 +	     req->ir_reply[2] & 0x7f, req->ir_reply[3] >> 4, req->ir_reply[3] & 0x0f,
  	     req->ir_reply[4] & 0x0f, req->ir_reply[4] >> 4);
  
  	ipmi_free_request(req);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: ru 
State-Changed-When: Tue Apr 19 07:44:17 UTC 2011 
State-Changed-Why:  
Fixed in 8.2-STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151586 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/151586: commit references a PR
Date: Tue, 19 Apr 2011 07:44:23 +0000 (UTC)

 Author: ru
 Date: Tue Apr 19 07:44:12 2011
 New Revision: 220816
 URL: http://svn.freebsd.org/changeset/base/220816
 
 Log:
   MFC r220614:
   
   Fixed firmware revision decoding:
   - the major is 7-bit binary encoded
   - the minor is BCD encoded
   
   PR:		kern/151586
 
 Modified:
   stable/8/sys/dev/ipmi/ipmi.c
 Directory Properties:
   stable/8/sys/   (props changed)
 
 Modified: stable/8/sys/dev/ipmi/ipmi.c
 ==============================================================================
 --- stable/8/sys/dev/ipmi/ipmi.c	Tue Apr 19 07:36:53 2011	(r220815)
 +++ stable/8/sys/dev/ipmi/ipmi.c	Tue Apr 19 07:44:12 2011	(r220816)
 @@ -713,10 +713,10 @@ ipmi_startup(void *arg)
  		return;
  	}
  
 -	device_printf(dev, "IPMI device rev. %d, firmware rev. %d.%d, "
 +	device_printf(dev, "IPMI device rev. %d, firmware rev. %d.%d%d, "
  	    "version %d.%d\n",
  	     req->ir_reply[1] & 0x0f,
 -	     req->ir_reply[2] & 0x0f, req->ir_reply[4],
 +	     req->ir_reply[2] & 0x7f, req->ir_reply[3] >> 4, req->ir_reply[3] & 0x0f,
  	     req->ir_reply[4] & 0x0f, req->ir_reply[4] >> 4);
  
  	ipmi_free_request(req);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
