# LSI 3108 raid card driver issue



## sixday (Aug 29, 2020)

Hi all,

I'm looking for some help how to enable the mpr driver (it is builtin into the GENERIC kernel)
I need to install a new supermicro server which has an Avago/LSI 3108 raid card onboard.
OS is 12.1
The installation was successful, and by default the OS is decided to use the mfi driver
Unfortunately both with the mfi driver and the mrsas driver (I tested both) after some intensive IO operations the server dies, only hard reset helps.
If I'm not doing any intensive IO the server stays alive for weeks, so it's definitely the disk subsystem.
I have 2 piece of 1TB Intel SSD attached in Raid1 configuration.

I was looking into how to tell the system to use the mpr driver, as this driver has the official support for this raid card (https://www.freebsd.org/cgi/man.cgi?query=mpr&sektion=4) but I simply cannot figure out how to force the kernel to use mpr instead of mfi/mrsas
Any ideas?

Thanks.


----------



## George (Aug 29, 2020)

The device probe method of mpr_pci.c returns  BUS_PROBE_DEFAULT.
The device probe method of mfi_pci.c has these lines:

```
/* give priority to mrsas if tunable set */
if ((id->flags & MFI_FLAGS_MRSAS) && mfi_mrsas_enable)
            return (BUS_PROBE_LOW_PRIORITY);
else
            return (BUS_PROBE_DEFAULT);
}
```

So there might be a tunable that you can put in /boot/loader.conf. BUS_PROBE_LOW_PRIORITY is described as "older, less desirable driver".
Maybe this one (?):

```
hw.mfi.mrsas_enable: Allow mrasas to take newer cards
```

Searching for a solution I came across PR 224496, which mentions LSI 3008 (but is unrelated to this thread).


----------



## sixday (Aug 29, 2020)

Yes, this is the way how to switch between mfi and mrsas drivers `hw.mfi.mrsas_enable`
My problem is that I'm unable to convince FreeBSD to use the mpr driver, it's either mfi or mrsas but none of these have support for my card, it supposed to use mpr but it's not doing it for some unknown reasons


----------



## T-Daemon (Aug 29, 2020)

Unless somebody has a better idea I would say build a custom kernel, excluding mfi and mrsas.


----------



## George (Aug 29, 2020)

mrsas(4) uses a priority of (-30), between BUS_PROBE_DEFAULT and BUS_PROBE_LOW_PRIORITY. So really, if mpr(4) wants the device, it should get it.

Can you show the `pciconf -v` of the card? ;D


----------



## sixday (Aug 29, 2020)

Elazar said:


> mrsas(4) uses a priority of (-30), between BUS_PROBE_DEFAULT and BUS_PROBE_LOW_PRIORITY. So really, if mpr(4) wants the device, it should get it.
> 
> Can you show the `pciconf -v` of the card? ;D



Sure thing, currently I'm using the mrsas driver:
`pciconf -l -v mrsas0
mrsas0@pci0:94:0:0:    class=0x010400 card=0x080915d9 chip=0x005d1000 rev=0x02 hdr=0x00
    vendor     = 'LSI Logic / Symbios Logic'
    device     = 'MegaRAID SAS-3 3108 [Invader]'
    class      = mass storage
    subclass   = RAID`


----------



## sixday (Aug 29, 2020)

Sorry for everybody, I just updated the thread and my comment, the raid card is 3108 and not 3008 as I originally stated.


----------



## George (Aug 29, 2020)

Maybe the mpr driver doesn't want to attach to this card.

If you parse through device_probe() of mpr, you get:

```
#define MPI2_MFGPAGE_VENDORID_LSI                   (0x1000)
...
#define MPI25_MFGPAGE_DEVID_SAS3108_1               (0x0090)
#define MPI25_MFGPAGE_DEVID_SAS3108_2               (0x0091)
#define MPI25_MFGPAGE_DEVID_SAS3108_5               (0x0094)
#define MPI25_MFGPAGE_DEVID_SAS3108_6               (0x0095)
```

I don't see these hex values in your `pciconf` output.

Maybe try a mailing list or open a PR at https://bugs.freebsd.org/bugzilla/. Driver developers are usually more active there.


----------

