⬢ DragonFlyBSD Kernel Audit
DF-3814 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/raid/mpr/mpr.c
+++ b/sys/dev/raid/mpr/mpr.c
@@ -712,10 +712,14 @@
 	}
 
 	/*
-	 * XXX If the number of MSI-X vectors changes during re-init, this
-	 * won't see it and adjust.
-	 */
-	if (attaching && (error = mpr_pci_setup_interrupts(sc)) != 0) {
+	 * mpr_iocfacts_free() above tore down every interrupt handler
+	 * when reallocating; they must be re-established or the controller
+	 * is left with no completion path.  (XXX If the number of MSI-X
+	 * vectors changes during re-init, msi_msgs has since been
+	 * recomputed by mpr_resize_queues(), so this tracks it.)
+	 */
+	if ((attaching || reallocating) &&
+	    (error = mpr_pci_setup_interrupts(sc)) != 0) {
 		mpr_dprint(sc, MPR_INIT|MPR_ERROR,
 		    "Failed to setup interrupts\n");
 		mpr_free(sc);