Patchwork [NET-NEXT,2/2] igb: loopback bits not correctly cleared from RCTL register

login
register
mail settings
Submitter Jeff Kirsher
Date Nov. 24, 2008, 11:49 p.m.
Message ID <20081124234903.24515.58872.stgit@gitlost.lost>
Download mbox | patch
Permalink /patch/10551/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jeff Kirsher - Nov. 24, 2008, 11:49 p.m.
From: Alexander Duyck <alexander.h.duyck@intel.com>

This change forces the bits to 0 by using an &= operation with an inverted
mask of all options instead of using an |= with a value of 0.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb_ethtool.c |    3 ++-
 drivers/net/igb/igb_main.c    |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Nov. 25, 2008, 9:04 a.m.
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 24 Nov 2008 15:49:03 -0800

> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> This change forces the bits to 0 by using an &= operation with an inverted
> mask of all options instead of using an |= with a value of 0.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 8e9d295..d5efbcc 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -1339,8 +1339,9 @@  static int igb_setup_desc_rings(struct igb_adapter *adapter)
 	wr32(E1000_RDLEN(0), rx_ring->size);
 	wr32(E1000_RDH(0), 0);
 	wr32(E1000_RDT(0), 0);
+	rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC);
 	rctl = E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_SZ_2048 |
-		E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
+		E1000_RCTL_RDMTS_HALF |
 		(adapter->hw.mac.mc_filter_type << E1000_RCTL_MO_SHIFT);
 	wr32(E1000_RCTL, rctl);
 	wr32(E1000_SRRCTL(0), 0);
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index ae65fae..ab37ab0 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1779,9 +1779,9 @@  static void igb_setup_rctl(struct igb_adapter *adapter)
 	rctl = rd32(E1000_RCTL);
 
 	rctl &= ~(3 << E1000_RCTL_MO_SHIFT);
+	rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC);
 
-	rctl |= E1000_RCTL_EN | E1000_RCTL_BAM |
-		E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
+	rctl |= E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_RDMTS_HALF |
 		(adapter->hw.mac.mc_filter_type << E1000_RCTL_MO_SHIFT);
 
 	/*