>Number:         154978
>Category:       kern
>Synopsis:       [patch] [mfi] Support MFI cards with boot option ROM disabled
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 23 16:10:07 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Boyer
>Release:        -current
>Organization:
Avere Systems
>Environment:
amd64
>Description:
I noticed that the mfi driver fails to load if the card's option ROM is 
disabled in the BIOS.  (If you're not booting from it, it reduces the boot time 
a lot.)  The LSI supported driver includes support for this mode of operation 
but the driver in the FreeBSD tree doesn't.  The change is very simple.  See 
the attached patch.  Would someone please test it / clean it up / commit it?

It's been tested to work with the MegaRAID SAS 9261-8i.
>How-To-Repeat:
1) Disable the SAS option ROM in the BIOS
2) Boot the system

>Fix:


Patch attached with submission follows:

Index: sys/dev/mfi/mfireg.h
===================================================================
--- sys/dev/mfi/mfireg.h        (revision 218580)
+++ sys/dev/mfi/mfireg.h        (working copy)
@@ -112,6 +112,7 @@
 #define MFI_FWSTATE_WAIT_HANDSHAKE     0x60000000
 #define MFI_FWSTATE_FW_INIT_2          0x70000000
 #define MFI_FWSTATE_DEVICE_SCAN                0x80000000
+#define MFI_FWSTATE_BOOT_MESSAGE_PENDING       0x90000000
 #define MFI_FWSTATE_FLUSH_CACHE                0xa0000000
 #define MFI_FWSTATE_READY              0xb0000000
 #define MFI_FWSTATE_OPERATIONAL                0xc0000000
@@ -127,6 +128,7 @@
 #define MFI_FWINIT_READY       0x00000002 /* Move from operational to ready */
 #define MFI_FWINIT_MFIMODE     0x00000004 /* unknown */
 #define MFI_FWINIT_CLEAR_HANDSHAKE 0x00000008 /* Respond to WAIT_HANDSHAKE */
+#define MFI_FWINIT_HOTPLUG     0x00000010
 
 /* MFI Commands */
 typedef enum {
Index: sys/dev/mfi/mfi.c
===================================================================
--- sys/dev/mfi/mfi.c   (revision 218580)
+++ sys/dev/mfi/mfi.c   (working copy)
@@ -260,8 +260,12 @@
                case MFI_FWSTATE_FLUSH_CACHE:
                        max_wait = 20;
                        break;
+               case MFI_FWSTATE_BOOT_MESSAGE_PENDING:
+                       MFI_WRITE4(sc, MFI_IDB, MFI_FWINIT_HOTPLUG);
+                       max_wait = 10;
+                       break;
                default:
-                       device_printf(sc->mfi_dev,"Unknown firmware state %d\n",
+                       device_printf(sc->mfi_dev,"Unknown firmware state 
%#x\n",
                            fw_state);
                        return (ENXIO);
                }
@@ -273,7 +277,7 @@
                                break;
                }
                if (fw_state == cur_state) {
-                       device_printf(sc->mfi_dev, "firmware stuck in state "
+                       device_printf(sc->mfi_dev, "Firmware stuck in state "
                            "%#x\n", fw_state);
                        return (ENXIO);
                }


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to