Skip to contentSkip to conversation

e1000e: Fix check_for_link return value with autoneg off.

PATCH In review Benjamin Poirier 3 participants 3 messages Feb 20, 2018 – Feb 24, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e1000e: Fix check_for_link return value with autoneg off.

When autoneg is off, the .check_for_link callback functions clear the get_link_status flag and systematically return a "pseudo-error". This means that the link is not detected as up until the next execution of the e1000_watchdog_task() 2 seconds later.

Fixes 19110cfbb34d ("e1000e: Separate signaling for link check/link up")
---
 drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 +-
 drivers/net/ethernet/intel/e1000e/mac.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/e1000e/ich8lan.c +1 -1
index 31277d3bb7dc..ff308b05d68c 100644
@@ -1602,7 +1602,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
 	 * we have already determined whether we have link or not.
 	 */
 	if (!mac->autoneg)
-		return -E1000_ERR_CONFIG;
+		return 1;
 
 	/* Auto-Neg is enabled.  Auto Speed Detection takes care
 	 * of MAC speed/duplex configuration.  So we only need to
drivers/net/ethernet/intel/e1000e/mac.c +1 -1
index f457c5703d0c..db735644b312 100644
@@ -450,7 +450,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
 	 * we have already determined whether we have link or not.
 	 */
 	if (!mac->autoneg)
-		return -E1000_ERR_CONFIG;
+		return 1;
 
 	/* Auto-Neg is enabled.  Auto Speed Detection takes care
 	 * of MAC speed/duplex configuration.  So we only need to
Signature · 1 line
2.16.1
Acked-by on v1 1/1
#1 lore raw
Quoted 31 lines · Benjamin Poirier

When autoneg is off, the .check_for_link callback functions clear the get_link_status flag and systematically return a "pseudo-error". This means that the link is not detected as up until the next execution of the e1000_watchdog_task() 2 seconds later.

Fixes 19110cfbb34d ("e1000e: Separate signaling for link check/link up")
---
  drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 +-
  drivers/net/ethernet/intel/e1000e/mac.c     | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/e1000e/ich8lan.c +1 -1
index 31277d3bb7dc..ff308b05d68c 100644
@@ -1602,7 +1602,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
  	 * we have already determined whether we have link or not.
  	 */
  	if (!mac->autoneg)
-		return -E1000_ERR_CONFIG;
+		return 1;
 
  	/* Auto-Neg is enabled.  Auto Speed Detection takes care
  	 * of MAC speed/duplex configuration.  So we only need to
drivers/net/ethernet/intel/e1000e/mac.c +0 -0
index f457c5703d0c..db735644b312 100644

drivers/net/ethernet/intel/e1000e/mac.c s32 e1000e_check_for_copper_link(struct e1000_hw *hw) · line 456

Quoted 8 lines
drivers/net/ethernet/intel/e1000e/mac.c +1 -1
@@ -450,7 +450,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
  	 * we have already determined whether we have link or not.
  	 */
  	if (!mac->autoneg)
-		return -E1000_ERR_CONFIG;
+		return 1;
 
  	/* Auto-Neg is enabled.  Auto Speed Detection takes care
  	 * of MAC speed/duplex configuration.  So we only need to
Tested-by on v1 1/1
#2 lore raw
In reply to Benjamin Poirier
Quoted 14 lines

From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Benjamin Poirier
Sent: Monday, February 19, 2018 10:12 PM
To: Kirsher, Jeffrey T <[email protected]>
Cc: netdev at vger.kernel.org; intel-wired-lan at lists.osuosl.org; linux- kernel at vger.kernel.org
Subject: [Intel-wired-lan] [PATCH net-queue] e1000e: Fix check_for_link return value with autoneg off.

When autoneg is off, the .check_for_link callback functions clear the get_link_status flag and systematically return a "pseudo-error". This means that the link is not detected as up until the next execution of the e1000_watchdog_task() 2 seconds later.

Quoted 7 lines
Fixes 19110cfbb34d ("e1000e: Separate signaling for link check/link up")
---
 drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 +-
 drivers/net/ethernet/intel/e1000e/mac.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)