Commit 844b3eed authored by Matt Carlson's avatar Matt Carlson Committed by David S. Miller

tg3: Refine tg3_vlan_rx_register()

tg3_vlan_rx_register() touches the hardware if netif_running() returns
false.  This patch fixes the problem.
Signed-off-by: default avatarMatt Carlson <mcarlson@broadcom.com>
Signed-off-by: default avatarBenjamin Li <benli@broadcom.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7e5856bd
...@@ -9896,8 +9896,12 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) ...@@ -9896,8 +9896,12 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
{ {
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = netdev_priv(dev);
if (netif_running(dev)) if (!netif_running(dev)) {
tg3_netif_stop(tp); tp->vlgrp = grp;
return;
}
tg3_netif_stop(tp);
tg3_full_lock(tp, 0); tg3_full_lock(tp, 0);
...@@ -9906,8 +9910,7 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) ...@@ -9906,8 +9910,7 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
/* Update RX_MODE_KEEP_VLAN_TAG bit in RX_MODE register. */ /* Update RX_MODE_KEEP_VLAN_TAG bit in RX_MODE register. */
__tg3_set_rx_mode(dev); __tg3_set_rx_mode(dev);
if (netif_running(dev)) tg3_netif_start(tp);
tg3_netif_start(tp);
tg3_full_unlock(tp); tg3_full_unlock(tp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment