netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 04/14] tg3: Refine tg3_vlan_rx_register()
@ 2009-02-26  0:23 Matt Carlson
  0 siblings, 0 replies; only message in thread
From: Matt Carlson @ 2009-02-26  0:23 UTC (permalink / raw)
  To: davem; +Cc: netdev, Michael Chan, Benjamin Li, andy

tg3_vlan_rx_register() touches the hardware if netif_running() returns
false.  This patch fixes the problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/tg3.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 0ea61f7..ce29097 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9896,8 +9896,12 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
 {
 	struct tg3 *tp = netdev_priv(dev);
 
-	if (netif_running(dev))
-		tg3_netif_stop(tp);
+	if (!netif_running(dev)) {
+		tp->vlgrp = grp;
+		return;
+	}
+
+	tg3_netif_stop(tp);
 
 	tg3_full_lock(tp, 0);
 
@@ -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. */
 	__tg3_set_rx_mode(dev);
 
-	if (netif_running(dev))
-		tg3_netif_start(tp);
+	tg3_netif_start(tp);
 
 	tg3_full_unlock(tp);
 }
-- 
1.6.0.6



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-26  2:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-26  0:23 [PATCH 04/14] tg3: Refine tg3_vlan_rx_register() Matt Carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).