re-enable mfii(4) aen

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

re-enable mfii(4) aen

Jonathan Matthew-4
Almost exactly a year ago (give or take an hour), we disabled AEN handling in mfii(4)
because it didn't work on SAS2208 controllers.  I finally got around to looking into this
and found we were just missing one magical offset in one of the command structures.  The
diff below add this and re-enables AEN processing.

I've tested on the following:

mfii0 at pci3 dev 0 function 0 "Symbios Logic MegaRAID SAS2208" rev 0x01: msi
mfii0: "PERC H710P Mini", firmware 21.0.2-0001, 1024MB cache

mfii0 at pci1 dev 0 function 0 "Symbios Logic MegaRAID SAS3108" rev 0x02: msi
mfii0: "PERC H730 Mini", firmware, 1024MB cache

Could someone test on a SAS3.5 controller (megaraid 34xx or 35xx)?  I don't have access to
one currently.  All you need to do is boot the resulting kernel and check mfii0 isn't
generating interrupts constantly.  Tests on other hardware would also be useful.

Index: mfii.c
RCS file: /cvs/src/sys/dev/pci/mfii.c,v
retrieving revision 1.46
diff -u -p -r1.46 mfii.c
--- mfii.c 2 Feb 2018 11:24:37 -0000 1.46
+++ mfii.c 11 Feb 2018 02:34:50 -0000
@@ -630,22 +630,18 @@ mfii_attach(struct device *parent, struc
-#ifdef notyet
  if (mfii_aen_register(sc) != 0) {
  /* error printed by mfii_aen_register */
  goto intr_disestablish;
  /* enable interrupts */
  mfii_write(sc, MFI_OSTS, 0xffffffff);
  mfii_write(sc, MFI_OMSK, ~MFII_OSTS_INTR_VALID);
-#ifdef notyet
  pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
  mfii_dmamem_free(sc, sc->sc_sgl);
@@ -851,6 +847,7 @@ mfii_dcmd_start(struct mfii_softc *sc, s
  io->sgl_offset0 = (uint32_t *)sge - (uint32_t *)io;
+ io->chain_offset = io->sgl_offset0 / 4;
  htolem64(&sge->sg_addr, ccb->ccb_sense_dva);
  htolem32(&sge->sg_len, sizeof(*ccb->ccb_sense));