igb: Disable interrupts before setting up the interrupt vectors
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 11 Mar 2013 08:15:00 +0000 (16:15 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 11 Mar 2013 08:15:00 +0000 (16:15 +0800)
The spurious interrupts (even MSI-X, that's amazing) had been observed
on several types of LOMs, before the devices were initialized, which
could potentially crash the system.  Disabling interrupts in hardware
and on serializers before setting up the interrupt vectors should be
enough.

See-also: FreeBSD PR kern/172113

sys/dev/netif/igb/if_igb.c

index 952da55..3d2830b 100644 (file)
@@ -669,6 +669,13 @@ igb_attach(device_t dev)
        igb_add_hw_stats(adapter);
 #endif
 
+       /*
+        * Disable interrupt to prevent spurious interrupts (line based
+        * interrupt, MSI or even MSI-X), which had been observed on
+        * several types of LOMs, from being handled.
+        */
+       igb_disable_intr(sc);
+
        error = igb_setup_intr(sc);
        if (error) {
                ether_ifdetach(&sc->arpcom.ac_if);