From nobody@FreeBSD.org  Fri Jun  1 18:57:27 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 76CE916A400
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  1 Jun 2007 18:57:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 5AC0813C455
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  1 Jun 2007 18:57:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l51IvR61047210
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 1 Jun 2007 18:57:27 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l51IvRl7047209;
	Fri, 1 Jun 2007 18:57:27 GMT
	(envelope-from nobody)
Message-Id: <200706011857.l51IvRl7047209@www.freebsd.org>
Date: Fri, 1 Jun 2007 18:57:27 GMT
From: "Brian A. Seklecki"<bseklecki@collaborativefusion.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mfi(4) patch to enable megacli(8) on Dell PowerEdge PERC5
X-Send-Pr-Version: www-3.0

>Number:         113232
>Category:       amd64
>Synopsis:       [mfi] [patch] mfi(4) patch to enable megacli(8) on Dell PowerEdge PERC5
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    ambrisko
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 01 19:00:10 GMT 2007
>Closed-Date:    Wed Jun 06 16:03:37 GMT 2007
>Last-Modified:  Wed Jun  6 16:10:00 GMT 2007
>Originator:     Brian A. Seklecki
>Release:        6.2 AMD64
>Organization:
Collaborative Fusion, Inc.
>Environment:
FreeBSD db06 6.2-RELEASE-p3 FreeBSD 6.2-RELEASE-p3 #2: Fri Jun  1 14:22:19 EDT 2007     root@db06:/usr/obj/usr/src/sys/DB-2950-AMD64  amd64

>Description:
    I have some Dell PowerEdge 1950 servers equipped with their PERC5/
i SAS RAID controller (OEM is LSI). In general they work fine. The
mfi driver is being used and I get some occasional blurbs logged by
the driver. I am having poor results though trying to get the megacli
port (sysutils/linux-megacli) to work with it.

    For example, if I call 'megacli -AdpAllInfo -aALL' I get junk/
empty output like:
Adapter #0

==============================================================================
                 Versions
                 ================
Product Name    :
Serial No       :
FW Package Build:
FW Version      :
BIOS Version    :
Ctrl-R Version  :

                 Pending Images In Flash
                 ================
None

                 PCI Info
                 ================
Vendor Id       : 0000
Device Id       : 0000
SubVendorId     : 0000
SubDeviceId     : 0000

Host Interface  : UNKOWN

Number of Frontend Port: 0
Device Interface  : UNKOWN
>How-To-Repeat:
Buy a $10,000 server; try to manage it in some professional manner. (megacli
via nrpe2 via Nagios plugins and all that jazz)
>Fix:
Apply the patch written/supplied by Bjoern A. Zeeb at:

http://patch.zabbadoz.net/freebsd/patchset/EXPERIMENTAL/20070319-01-mfi-MFC.diff

seklecki@ravage:/export/RELENG_6_2/src/sys/dev/mfi$ sudo patch -p0 < ~/20070319-01-mfi-MFC.diff 
Password:
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|? patches
|Index: mfi.c
|===================================================================
|RCS file: /export/media/FreeBSD/cvsup/r/ncvs/src/sys/dev/mfi/mfi.c,v
|retrieving revision 1.3.2.5
|diff -u -p -r1.3.2.5 mfi.c
|--- mfi.c      7 Jan 2007 06:44:37 -0000       1.3.2.5
|+++ mfi.c      19 Mar 2007 17:46:02 -0000
--------------------------
Patching file mfi.c using Plan A...
Hunk #1 succeeded at 681.
Hunk #2 succeeded at 693.
Hunk #3 succeeded at 1337.
Hunk #4 succeeded at 1689.
Hunk #5 succeeded at 1710.
Hunk #6 succeeded at 1800.
Hunk #7 succeeded at 1828.
Hunk #8 succeeded at 1969.
Hunk #9 succeeded at 2007.
Hunk #10 succeeded at 2055.
Hunk #11 succeeded at 2068.
Hunk #12 succeeded at 2090.
Hunk #13 succeeded at 2105.
Hunk #14 succeeded at 2122.
Hunk #15 succeeded at 2144.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: mfi_ioctl.h
|===================================================================
|RCS file: /export/media/FreeBSD/cvsup/r/ncvs/src/sys/dev/mfi/mfi_ioctl.h,v
|retrieving revision 1.1.2.2
|diff -u -p -r1.1.2.2 mfi_ioctl.h
|--- mfi_ioctl.h        15 Jun 2006 16:07:56 -0000      1.1.2.2
|+++ mfi_ioctl.h        19 Mar 2007 17:46:02 -0000
--------------------------
Patching file mfi_ioctl.h using Plan A...
Hunk #1 succeeded at 27.
Hunk #2 succeeded at 50.
Hunk #3 succeeded at 91.
Hunk #4 succeeded at 106.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: mfi_linux.c
|===================================================================
|RCS file: /export/media/FreeBSD/cvsup/r/ncvs/src/sys/dev/mfi/mfi_linux.c,v
|retrieving revision 1.1.2.1
|diff -u -p -r1.1.2.1 mfi_linux.c
|--- mfi_linux.c        15 Jun 2006 16:07:56 -0000      1.1.2.1
|+++ mfi_linux.c        19 Mar 2007 17:46:02 -0000
--------------------------
Patching file mfi_linux.c using Plan A...
Hunk #1 succeeded at 45.
Hunk #2 succeeded at 84.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: mfireg.h
|===================================================================
|RCS file: /export/media/FreeBSD/cvsup/r/ncvs/src/sys/dev/mfi/mfireg.h,v
|retrieving revision 1.1.2.4
|diff -u -p -r1.1.2.4 mfireg.h
|--- mfireg.h   21 Oct 2006 05:28:50 -0000      1.1.2.4
|+++ mfireg.h   19 Mar 2007 17:46:02 -0000
--------------------------
Patching file mfireg.h using Plan A...
Hunk #1 succeeded at 279.
done


----

Afterwards get:

[seklecki@db06 ~]$ sudo megacli -AdpAllInfo -aALL
Password:
                                     
Adapter #0

==============================================================================
                Versions
                ================
Product Name    : PERC 5/i Integrated
Serial No       : 12345
FW Package Build: 5.1.1-0040
FW Version      : 1.03.10-0216
BIOS Version    : MT28
Ctrl-R Version  :1.04-017A

                Pending Images In Flash
                ================
None

                PCI Info
                ================
Vendor Id       : 1028
Device Id       : 0015
SubVendorId     : 1028
SubDeviceId     : 1f03

Host Interface  : PCIE

Number of Frontend Port: 0 
Device Interface  : PCIE

Number of Backend Port: 8 
Port  :  Address
0        5000c500005dad19 
1        5000c500005da6e9 
2        5000c50001cf9301 
3        5000c50001cfb2c1 
4        5000c500049065cd 
5        5000c50001cf9d61 
6        0000000000000000 
7        0000000000000000 

                HW Configuration
                ================
SAS Address     : 50019b90cb771f00
BBU             : Present
Alarm           : Absent
NVRAM           : Present
Serial Debugger : Present
Memory          : Present
Flash           : Present

                Settings
                ================
Current Time                     : 14:26:27 6/1, 2007
Predictive Fail Poll Interval    : 300sec
Interrupt Throttle Active Count  : 16
Interrupt Throttle Completion    : 50us
Rebuild Rate                     : 30%
PR Rate                          : 30%
Resynch Rate                     : 30%
Check Consistency Rate           : 30%
Reconstruction Rate              : 30%
Cache flush interval             : 4s
Max drives to spinup at one time : 2
Delay among spinup groups        : 12s
Physical drive coercion mode     : 128MB
Cluster mode                     : Disabled
Alarm                            : Disabled
Auto Rebuild                     : Enabled
Battery Warning                  : Enabled

Ecc Bucket Size                  : 15
Ecc Bucket Leak Rate             : 1440 Minutes
Restore HotSpare On Insertion    : Disabled
Expose Enclosure Devices         : Disabled
Maintain PD Fail History         : Disabled
Host Request Reordering          : Enabled

                Capabilities
                ================
RAID Level Supported             : RAID0, RAID1, RAID5, RAID10, RAID50
Supported Drives                 : SAS, SATA

Allowed Mixing:
Mix In Enclosure Allowed

                Status
                ================
ECC Bucket Count                 : 0

                Limitations
                ================
Max Arms Per VD         : 32 
Max Spans Per VD        : 8 
Max Arrays              : 128 
Max Number of VDs       : 64 
Max Parallel Commands   : 1008 
Max SGE Count           : 80 
Max Data Transfer Size  : 8192 sectors 
Max Strips PerIO        : 84 
Min Stripe Size         : 8kB
Max Stripe Size         : 128kB

                Device Present
                ================
Virtual Drives    : 2 
  Degraded        : 0 
  Offline         : 0 
Physical Devices  : 7 
  Disks           : 6 
  Critical Disks  : 0 
  Failed Disks    : 0 

                Supported Adapter Operations
                ================
Rebuild Rate                    : Yes
CC Rate                         : Yes
BGI Rate                        : Yes
Reconstruct Rate                : Yes
Patrol Read Rate                : Yes
Alarm Control                   : Yes
Cluster Support                 : No
BBU                             : Yes
Spanning                        : Yes
Dedicated Hot Spare             : Yes
revertible Hot Spares           : No
Foreign Config Import           : Yes
Self Diagnostic                 : Yes
Allow Mixed Redundancy On Array : No
Global Hot Spares               : Yes
Deny SCSI Passthrough           : No
Deny SMP Passthrough            : No
Deny STP Passthrough            : No

                Supported VD Operations
                ================
Read Policy          : Yes
Write Policy         : Yes
IO Policy            : Yes
Access Policy        : Yes
Disk Cache Policy    : Yes
Reconstruction       : Yes
Deny Locate          : No
Deny CC              : No

                Supported PD Operations
                ================
Force Online              : Yes
Force Offline             : Yes
Force Rebuild             : Yes
Deny Force Failed         : No
Deny Force Good/Bad       : No
Deny Missing Replace      : No
Deny Clear                : No
Deny Locate               : No

                Error Counters
                ================
Memory Correctable Errors   : 0 
Memory Uncorrectable Errors : 0 

                Cluster Information
                ================
Cluster Permitted     : No
Cluster Active        : No

                Default Settings
                ================
Phy Polarity                   : 0 
Phy PolaritySplit              : 0 
Backgroud Rate                 : 30 
Stripe Size                    : 64kB
Flush Time                     : 4 seconds
Write Policy                   : WB
Read Policy                    : None
Cache When BBU Bad             : Disabled
Cached IO                      : No
SMART Mode                     : Mode 6
Alarm Disable                  : No
Coercion Mode                  : 128MB
ZCR Config                     : IDSEL
Dirty LED Shows Drive Activity : No
BIOS Continue On Error         : No
Spin Down Mode                 : None
Allowed Device Type            : SAS/SATA Mix
Allow Mix In Enclosure         : Yes
Allow Mix In VD                : No
Allow SATA In Cluster          : No
Max Chained Enclosures         : 1 
Disable Ctrl-R                 : No
Enable Web BIOS                : No
Direct PD Mapping              : No
BIOS Enumerate VDs             : No
Restore Hot Spare On Insertion : No
Expose Enclosure Devices       : No
Maintain PD Fail History       : No

[seklecki@db06 ~]$ grep -i mfi /var/run/dmesg.boot 
mfi0: <Dell PERC 5/i> mem 0xd80f0000-0xd80fffff,0xfc6e0000-0xfc6fffff irq 78 at device 14.0 on pci2
mfi0: 769 (234024018s/0x0020/0) - Shutdown command received from host
mfi0: 770 (4278190080s/0x0020/0) - PCI 0x041028 0x0415 0x041028 0x041f03: Firmware initialization started (PCI ID 0015/1028/1f03/1028)
mfi0: 771 (4278190080s/0x0020/0) - Type 18: Firmware version 1.03.10-0216
mfi0: 772 (4278190094s/0x0008/0) - Battery Present
mfi0: 773 (4278190094s/0x0020/0) - Type 18: Package version 5.1.1-0040
mfi0: 774 (4278190121s/0x0004/0) - PD 08(e1/s255) event: Enclosure (SES) discovered on PD 08(e1/s255)
mfi0: 775 (4278190122s/0x0002/0) - PD 08(e1/s255) event: Inserted: PD 08(e1/s255)
mfi0: 776 (4278190122s/0x0002/0) - Type 29: Inserted: PD 08(e1/s255) Info: enclPd=08, scsiType=d, portMap=00, sasAddr=50019090cb771f00,0000000000000000
mfi0: 777 (4278190122s/0x0002/0) - PD 00(e1/s0) event: Inserted: PD 00(e1/s0)
mfi0: 778 (4278190122s/0x0002/0) - Type 29: Inserted: PD 00(e1/s0) Info: enclPd=08, scsiType=0, portMap=01, sasAddr=5000c500005dad19,0000000000000000
mfi0: 779 (4278190122s/0x0002/0) - PD 01(e1/s1) event: Inserted: PD 01(e1/s1)
mfi0: 780 (4278190122s/0x0002/0) - Type 29: Inserted: PD 01(e1/s1) Info: enclPd=08, scsiType=0, portMap=02, sasAddr=5000c500005da6e9,0000000000000000
mfi0: 781 (4278190122s/0x0002/0) - PD 02(e1/s2) event: Inserted: PD 02(e1/s2)
mfi0: 782 (4278190122s/0x0002/0) - Type 29: Inserted: PD 02(e1/s2) Info: enclPd=08, scsiType=0, portMap=04, sasAddr=5000c50001cf9301,0000000000000000
mfi0: 783 (4278190122s/0x0002/0) - PD 03(e1/s3) event: Inserted: PD 03(e1/s3)
mfi0: 784 (4278190122s/0x0002/0) - Type 29: Inserted: PD 03(e1/s3) Info: enclPd=08, scsiType=0, portMap=08, sasAddr=5000c50001cfb2c1,0000000000000000
mfi0: 785 (4278190122s/0x0002/0) - PD 04(e1/s4) event: Inserted: PD 04(e1/s4)
mfi0: 786 (4278190122s/0x0002/0) - Type 29: Inserted: PD 04(e1/s4) Info: enclPd=08, scsiType=0, portMap=10, sasAddr=5000c500049065cd,0000000000000000
mfi0: 787 (4278190122s/0x0002/0) - PD 05(e1/s5) event: Inserted: PD 05(e1/s5)
mfi0: 788 (4278190122s/0x0002/0) - Type 29: Inserted: PD 05(e1/s5) Info: enclPd=08, scsiType=0, portMap=20, sasAddr=5000c50001cf9d61,0000000000000000
mfi0: 789 (234024074s/0x0020/0) - Adapter ticks 234024074 elapsed 43s: Time established as 06/01/07 14:41:14; (43 seconds since power on)
mfid0: <MFI Logical Disk> on mfi0
mfid0: 34176MB (69992448 sectors) RAID volume '' is optimal
mfid1: <MFI Logical Disk> on mfi0
mfid1: 138752MB (284164096 sectors) RAID volume '' is optimal
Trying to mount root from ufs:/dev/mfid0s1a
mfi0: 790 (234024130s/0x0008/0) - Battery temperature is normal
mfi0: 791 (234024130s/0x0008/0) - Current capacity of the battery is above threshold

ACPI APIC Table: <DELL   PE_SC3  >
acpi0: <DELL PE_SC3> on motherboard



>Release-Note:
>Audit-Trail:

From: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To: "Brian A. Seklecki" <bseklecki@collaborativefusion.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: amd64/113232: mfi(4) patch to enable megacli(8) on Dell PowerEdge
 PERC5
Date: Sat, 2 Jun 2007 11:11:49 +0000 (UTC)

 On Fri, 1 Jun 2007, Brian A. Seklecki wrote:
 
 Hi,
 
 > Number:         113232
 > Category:       amd64
 > Synopsis:       mfi(4) patch to enable megacli(8) on Dell PowerEdge PERC5
 
 what's this PR about? You want my patch to be merged to RELENG_6?
 If so I can ask the people who did the actual work on HEAD if they are
 willing to do so.
 
 Be remembered that you can hang controller if you are using
 linux-megacli and the wrong commands. Check whatever works for your
 hardware before putting the machine into production and write it down
 and be prepared to press the power button multiple times during this
 testing to get the machine back to life and fsck your filesystems!
 
 -- 
 Bjoern A. Zeeb				bzeeb at Zabbadoz dot NeT
Responsible-Changed-From-To: freebsd-amd64->ambrisko 
Responsible-Changed-By: ambrisko 
Responsible-Changed-When: Mon Jun 4 16:55:26 UTC 2007 
Responsible-Changed-Why:  
I'll take this.  We wanted to address some other issues in -current before 
MFC'ing some code that had know issues and didn't solve some critical  
problems (panic's) that we found.  I just committed some fixes to -current 
so the new -current stuff will be MFC'ed shortly to 6.X.  Sorry for the 
delay, Scott and myself have been busy with various things. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113232 
State-Changed-From-To: open->closed 
State-Changed-By: ambrisko 
State-Changed-When: Wed Jun 6 15:59:47 UTC 2007 
State-Changed-Why:  
This should be resolved now.  We have MFC'ed all of the mfi changes now. 
Let me know if I have messed up/missed something.  An amd64 kernel should 
not crash now.  On both i386 & amd64 some MegaCli commands will not 
work like flashing the firmware :-(  I don't know what is messing up 
MegaCli.  It works on a real Linux box.  I should do a port for MegaCli 
and commit it.  It's better then nothing since that is all the general 
FreeBSD community has :-( 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: amd64/113232: commit references a PR
Date: Wed,  6 Jun 2007 15:59:39 +0000 (UTC)

 ambrisko    2007-06-06 15:59:30 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     sys/conf             files.amd64 
     sys/dev/mfi          mfi.c mfi_disk.c mfi_ioctl.h mfi_linux.c 
                          mfi_pci.c mfireg.h mfivar.h 
   Log:
   MFC all of the remaining changes.  This brings over improved ioctl
   support and makes MegaCli work on amd64.  Scott supplied patches
   to make the ioctl commands not block the controller.  MegaCli
   still has some issues with our emulation and create some bogus
   commands so flashing doesn't work.
   
   This should loosely resolve 113232.  We were waiting on some other
   fixes to go into -current before migrating this to -stable.
   
   PR:             113232
   Submitted by:   scottl
   
   Revision   Changes    Path
   1.71.2.13  +1 -0      src/sys/conf/files.amd64
   1.3.2.7    +246 -133  src/sys/dev/mfi/mfi.c
   1.2.2.5    +24 -18    src/sys/dev/mfi/mfi_disk.c
   1.1.2.3    +57 -0     src/sys/dev/mfi/mfi_ioctl.h
   1.1.2.2    +14 -1     src/sys/dev/mfi/mfi_linux.c
   1.1.2.5    +9 -7      src/sys/dev/mfi/mfi_pci.c
   1.1.2.6    +2 -1      src/sys/dev/mfi/mfireg.h
   1.1.2.6    +11 -5     src/sys/dev/mfi/mfivar.h
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
