NetBSD Problem Report #48233

From www@NetBSD.org  Tue Sep 24 00:13:41 2013
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 45BDE72613
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 24 Sep 2013 00:13:41 +0000 (UTC)
Message-Id: <20130924001339.B4C0072614@mollari.NetBSD.org>
Date: Tue, 24 Sep 2013 00:13:39 +0000 (UTC)
From: nathanialsloss@yahoo.com.au
Reply-To: nathanialsloss@yahoo.com.au
To: gnats-bugs@NetBSD.org
Subject: IPMI hack for HP microserver with remote access card
X-Send-Pr-Version: www-1.0

>Number:         48233
>Category:       kern
>Synopsis:       IPMI hack for HP microserver with remote access card
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 24 00:15:00 +0000 2013
>Closed-Date:    Mon Sep 22 13:34:13 +0000 2014
>Last-Modified:  Sat Mar 25 14:50:01 +0000 2017
>Originator:     Nat Sloss
>Release:        NetBSD Current 6.99.23
>Organization:
>Environment:
NetBSD beast 6.99.23 NetBSD 6.99.23 (LOCKDEBUG) #4: Wed Jul 17 22:24:41 EST 2013  build@beast:/usr/src/sys/arch/i386/compile/obj/LOCKDEBUG i386

>Description:
I have a hp microserver n54l with optional remote access card.

The remote access card should attach as an ipmi device but the smbios table points to the wrong base address and does not attach.

I've found this documented on several internet sites and the root cause of the problem is that the returned base address is 0xca9 where as it should be 0xca2.
>How-To-Repeat:
Boot standard kernel with hp microserver with a remote access card installed and ipmi does not attach.
>Fix:
Add options HPMICROSERVER_IPMI to kernel config file and apply this patch.

Index: src/sys/arch/x86/x86/ipmi.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/ipmi.c,v
retrieving revision 1.55
diff -u -r1.55 ipmi.c
--- src/sys/arch/x86/x86/ipmi.c	12 Aug 2013 15:40:34 -0000	1.55
+++ src/sys/arch/x86/x86/ipmi.c	24 Sep 2013 00:01:16 -0000
@@ -936,6 +936,13 @@
 	if (pipmi->smipmi_base_flags & SMIPMI_FLAG_ODDOFFSET)
 		ia->iaa_if_iobase++;

+#if defined(HPMICROSERVER_IPMI)
+	ia->iaa_if_iospacing = 1;
+	ia->iaa_if_iobase = pipmi->smipmi_base_address - 7;
+	ia->iaa_if_iotype = 'i';
+	return;
+#endif
+
 	if (pipmi->smipmi_base_flags == 0x7f) {
 		/* IBM 325 eServer workaround */
 		ia->iaa_if_iospacing = 1;

I'd also like to request that if this patch is suitable or a better one arises that NetBSD 6 be pulled up.

Regards,

Nat.

>Release-Note:

>Audit-Trail:
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: re: kern/48233: IPMI hack for HP microserver with remote access card
Date: Tue, 24 Sep 2013 11:21:21 +1000

 thanks for looking at this.  i've been considering one of these boxes
 for my own purposes..

 > +#if defined(HPMICROSERVER_IPMI)
 > +	ia->iaa_if_iospacing = 1;
 > +	ia->iaa_if_iobase = pipmi->smipmi_base_address - 7;
 > +	ia->iaa_if_iotype = 'i';
 > +	return;
 > +#endif

 hmmm.  since we know what machines this is a problem on can we replace
 this #ifdef with something that compares it to the data that acpi/bios
 gave us about the platform?  i'm not sure how this works on PCs, but
 eg, something like

 	if (strcmp(hw_model, "HP Microserver n54L") == 0) {
 		ia->iaa_if_iospacing = 1;
 		ia->iaa_if_iobase = pipmi->smipmi_base_address - 7;
 		ia->iaa_if_iotype = 'i';
 		return;
 	}

 i'm pretty sure this info can be reliably obtained on the HP systems.

 thanks!


 .mrg.

From: Nat Sloss <nathanialsloss@yahoo.com.au>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/48233: IPMI hack for HP microserver with remote access card
Date: Wed, 25 Sep 2013 08:36:11 +1000

 Hi,

 As suggested by mrg, here is a better patch that does not require a kernel 
 define.  It should work on all G7 ProLiant Microservers with remote access 
 cards,  although I can only test with the n54l.

 Index: src/sys/arch/x86/x86/ipmi.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/x86/x86/ipmi.c,v
 retrieving revision 1.55
 diff -u -r1.55 ipmi.c
 --- src/sys/arch/x86/x86/ipmi.c	12 Aug 2013 15:40:34 -0000	1.55
 +++ src/sys/arch/x86/x86/ipmi.c	24 Sep 2013 22:58:00 -0000
 @@ -936,6 +936,14 @@
  	if (pipmi->smipmi_base_flags & SMIPMI_FLAG_ODDOFFSET)
  		ia->iaa_if_iobase++;

 +	if (strcmp(pmf_get_platform("system-product"),
 +            "ProLiant MicroServer") == 0) {
 +                ia->iaa_if_iospacing = 1;
 +                ia->iaa_if_iobase = pipmi->smipmi_base_address - 7;
 +                ia->iaa_if_iotype = 'i';
 +                return;
 +        }
 +
  	if (pipmi->smipmi_base_flags == 0x7f) {
  		/* IBM 325 eServer workaround */
  		ia->iaa_if_iospacing = 1;

 Regards,

 Nat.

State-Changed-From-To: open->closed
State-Changed-By: nat@NetBSD.org
State-Changed-When: Mon, 22 Sep 2014 13:34:13 +0000
State-Changed-Why:
Patch from PR committed.


From: "Nathanial Sloss" <nat@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48233 CVS commit: src/sys/arch/x86/x86
Date: Mon, 22 Sep 2014 13:30:55 +0000

 Module Name:	src
 Committed By:	nat
 Date:		Mon Sep 22 13:30:55 UTC 2014

 Modified Files:
 	src/sys/arch/x86/x86: ipmi.c

 Log Message:
 Make remote access cards on HP ProLiant microservers N36L,
 N40L and N54L work with ipmi(4).

 Addresses PR 48233.

 This commit was approved by christos@


 To generate a diff of this commit:
 cvs rdiff -u -r1.58 -r1.59 src/sys/arch/x86/x86/ipmi.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Satoshi Yatagawa <yata_netbsd@y.haun.org>
To: gnats-bugs@NetBSD.org
Cc: yata_netbsd@y.haun.org
Subject: Re: kern/48233
Date: Sat, 25 Mar 2017 22:30:48 +0900 (JST)

 I think that -current kernel (as of 7.99.66) have same problem again.

 "HP MicroServer Remote Access Card User Manual" says
 "The default system base address for the I/O mapped KCS Interface
 is 0xCA2 and is byte aligned at this system address.",

 but I think that a logic (introduced in src/sys/arch/x86/x86/ipmi.c
 rev 1.63) is not match to the address.

 The following patch fix this.

 Index: sys/arch/x86/x86/ipmi.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/x86/x86/ipmi.c,v
 retrieving revision 1.64
 diff -u -r1.64 ipmi.c
 --- sys/arch/x86/x86/ipmi.c     7 Jul 2016 06:55:40 -0000       1.64
 +++ sys/arch/x86/x86/ipmi.c     25 Mar 2017 12:47:43 -0000
 @@ -942,7 +942,7 @@
             strcmp(platform, "ProLiant MicroServer") == 0 &&
             pipmi->smipmi_base_address != 0) {
                  ia->iaa_if_iospacing = 1;
 -                ia->iaa_if_iobase = pipmi->smipmi_base_address & ~0x7;
 +                ia->iaa_if_iobase = (pipmi->smipmi_base_address & ~0x7) - 6;
                  ia->iaa_if_iotype = 'i';
                  return;
          }

 My new kernel with this fix allows attaching as ipmi device again.

 % dmesg | grep ipmi0
 ipmi0 at mainbus0
 ipmi0: version 1.5 interface KCS iobase 0xca2/2 spacing 1

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.