The diff below fixes the management command code path such that it
works again when polled command completion is needed.  This is
important for flushing the caches when we end up in ddb and want to do
a kernel crash dump or reboot.

I don't have this hardware myself, so some tests would be appreciated.

ok?


Index: mfi.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/mfi.c,v
retrieving revision 1.146
diff -u -p -r1.146 mfi.c
--- mfi.c       18 May 2013 08:39:47 -0000      1.146
+++ mfi.c       29 Jul 2013 09:34:07 -0000
@@ -1330,9 +1330,11 @@ mfi_do_mgmt(struct mfi_softc *sc, struct
 
        DNPRINTF(MFI_D_MISC, "%s: mfi_do_mgmt %#x\n", DEVNAME(sc), opc);
 
-       dma_buf = dma_alloc(len, PR_WAITOK);
-       if (dma_buf == NULL)
-               goto done;
+       if (len > 0) {
+               dma_buf = dma_alloc(len, cold ? PR_NOWAIT : PR_WAITOK);
+               if (dma_buf == NULL)
+                       goto done;
+       }
 
        dcmd = &ccb->ccb_frame->mfr_dcmd;
        memset(dcmd->mdf_mbox, 0, MFI_MBOX_SIZE);

Reply via email to