Commit 29315e8770c20cbfe607ad962d87867115a44555

Authored by Michael Chan
Committed by David S. Miller
1 parent 3820c3f3e4

[TG3]: Add tg3_netif_stop() in vlan functions

Add tg3_netif_stop() when changing the vlgrp (vlan group) pointer. It
is necessary to quiesce the device before changing that pointer.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 12 additions and 0 deletions Side-by-side Diff

... ... @@ -8738,6 +8738,9 @@
8738 8738 {
8739 8739 struct tg3 *tp = netdev_priv(dev);
8740 8740  
  8741 + if (netif_running(dev))
  8742 + tg3_netif_stop(tp);
  8743 +
8741 8744 tg3_full_lock(tp, 0);
8742 8745  
8743 8746 tp->vlgrp = grp;
8744 8747  
8745 8748  
... ... @@ -8746,16 +8749,25 @@
8746 8749 __tg3_set_rx_mode(dev);
8747 8750  
8748 8751 tg3_full_unlock(tp);
  8752 +
  8753 + if (netif_running(dev))
  8754 + tg3_netif_start(tp);
8749 8755 }
8750 8756  
8751 8757 static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
8752 8758 {
8753 8759 struct tg3 *tp = netdev_priv(dev);
8754 8760  
  8761 + if (netif_running(dev))
  8762 + tg3_netif_stop(tp);
  8763 +
8755 8764 tg3_full_lock(tp, 0);
8756 8765 if (tp->vlgrp)
8757 8766 tp->vlgrp->vlan_devices[vid] = NULL;
8758 8767 tg3_full_unlock(tp);
  8768 +
  8769 + if (netif_running(dev))
  8770 + tg3_netif_start(tp);
8759 8771 }
8760 8772 #endif
8761 8773