]> err.no Git - linux-2.6/blobdiff - drivers/net/forcedeth.c
ihex: add ihex2fw tool for converting HEX files into firmware images
[linux-2.6] / drivers / net / forcedeth.c
index 2cb2447632928a4fd4bc9972a9f375a96065c4ae..20d4fe96a81cc57b98bbedc255a395c2a065183a 100644 (file)
@@ -4194,12 +4194,23 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
 
        netif_carrier_off(dev);
        if (netif_running(dev)) {
+               unsigned long flags;
+
                nv_disable_irq(dev);
                netif_tx_lock_bh(dev);
-               spin_lock(&np->lock);
+               /* with plain spinlock lockdep complains */
+               spin_lock_irqsave(&np->lock, flags);
                /* stop engines */
+               /* FIXME:
+                * this can take some time, and interrupts are disabled
+                * due to spin_lock_irqsave, but let's hope no daemon
+                * is going to change the settings very often...
+                * Worst case:
+                * NV_RXSTOP_DELAY1MAX + NV_TXSTOP_DELAY1MAX
+                * + some minor delays, which is up to a second approximately
+                */
                nv_stop_rxtx(dev);
-               spin_unlock(&np->lock);
+               spin_unlock_irqrestore(&np->lock, flags);
                netif_tx_unlock_bh(dev);
        }