em(4): Don't write ITR, if the NIC is not running yet.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 27 Feb 2009 13:30:25 +0000 (21:30 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 27 Feb 2009 13:49:55 +0000 (21:49 +0800)
sys/dev/netif/em/if_em.c

index 29f72ca..31bf443 100644 (file)
@@ -3983,7 +3983,9 @@ em_sysctl_int_throttle(SYSCTL_HANDLER_ARGS)
                adapter->int_throttle_ceil = 1000000000 / 256 / throttle;
        else
                adapter->int_throttle_ceil = 0;
-       E1000_WRITE_REG(&adapter->hw, E1000_ITR, throttle);
+
+       if (ifp->if_flags & IFF_RUNNING)
+               E1000_WRITE_REG(&adapter->hw, E1000_ITR, throttle);
 
        lwkt_serialize_exit(ifp->if_serializer);