ath79: ag71xx: Fix tx queue timeouts during ifup
[openwrt/openwrt.git] / target / linux / ath79 / files / drivers / net / ethernet / atheros / ag71xx / ag71xx_main.c
index 70ca024..d809bbe 100644 (file)
@@ -805,10 +805,19 @@ err:
 
 static int ag71xx_stop(struct net_device *dev)
 {
+       unsigned long flags;
        struct ag71xx *ag = netdev_priv(dev);
 
        netif_carrier_off(dev);
        phy_stop(ag->phy_dev);
+
+       spin_lock_irqsave(&ag->lock, flags);
+       if (ag->link) {
+               ag->link = 0;
+               ag71xx_link_adjust(ag);
+       }
+       spin_unlock_irqrestore(&ag->lock, flags);
+
        ag71xx_hw_disable(ag);
 
        return 0;