Skip to content

Commit dc2aa33

Browse files
gobenjigregkh
authored andcommitted
Revert "e1000e: Separate signaling for link check/link up"
commit 3016e0a upstream. This reverts commit 19110cf. This reverts commit 4110e02. This reverts commit d3604515c9eda464a92e8e67aae82dfe07fe3c98. Commit 19110cf ("e1000e: Separate signaling for link check/link up") changed what happens to the link status when there is an error which happens after "get_link_status = false" in the copper check_for_link callbacks. Previously, such an error would be ignored and the link considered up. After that commit, any error implies that the link is down. Revert commit 19110cf ("e1000e: Separate signaling for link check/link up") and its followups. After reverting, the race condition described in the log of commit 19110cf is reintroduced. It may still be triggered by LSC events but this should keep the link down in case the link is electrically unstable, as discussed. The race may no longer be triggered by RXO events because commit 4aea7a5 ("e1000e: Avoid receiver overrun interrupt bursts") restored reading icr in the Other handler. Link: https://lkml.org/lkml/2018/3/1/789 Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Acked-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7a5b2bf commit dc2aa33

3 files changed

Lines changed: 9 additions & 19 deletions

File tree

drivers/net/ethernet/intel/e1000e/ich8lan.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,9 +1367,6 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
13671367
* Checks to see of the link status of the hardware has changed. If a
13681368
* change in link status has been detected, then we read the PHY registers
13691369
* to get the current speed/duplex if link exists.
1370-
*
1371-
* Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link
1372-
* up).
13731370
**/
13741371
static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
13751372
{
@@ -1385,7 +1382,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
13851382
* Change or Rx Sequence Error interrupt.
13861383
*/
13871384
if (!mac->get_link_status)
1388-
return 1;
1385+
return 0;
13891386

13901387
/* First we want to see if the MII Status Register reports
13911388
* link. If so, then we want to get the current speed/duplex
@@ -1602,7 +1599,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
16021599
* we have already determined whether we have link or not.
16031600
*/
16041601
if (!mac->autoneg)
1605-
return 1;
1602+
return -E1000_ERR_CONFIG;
16061603

16071604
/* Auto-Neg is enabled. Auto Speed Detection takes care
16081605
* of MAC speed/duplex configuration. So we only need to
@@ -1616,12 +1613,10 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
16161613
* different link partner.
16171614
*/
16181615
ret_val = e1000e_config_fc_after_link_up(hw);
1619-
if (ret_val) {
1616+
if (ret_val)
16201617
e_dbg("Error configuring flow control\n");
1621-
return ret_val;
1622-
}
16231618

1624-
return 1;
1619+
return ret_val;
16251620
}
16261621

16271622
static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)

drivers/net/ethernet/intel/e1000e/mac.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,6 @@ void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw)
410410
* Checks to see of the link status of the hardware has changed. If a
411411
* change in link status has been detected, then we read the PHY registers
412412
* to get the current speed/duplex if link exists.
413-
*
414-
* Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link
415-
* up).
416413
**/
417414
s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
418415
{
@@ -426,7 +423,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
426423
* Change or Rx Sequence Error interrupt.
427424
*/
428425
if (!mac->get_link_status)
429-
return 1;
426+
return 0;
430427

431428
/* First we want to see if the MII Status Register reports
432429
* link. If so, then we want to get the current speed/duplex
@@ -450,7 +447,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
450447
* we have already determined whether we have link or not.
451448
*/
452449
if (!mac->autoneg)
453-
return 1;
450+
return -E1000_ERR_CONFIG;
454451

455452
/* Auto-Neg is enabled. Auto Speed Detection takes care
456453
* of MAC speed/duplex configuration. So we only need to
@@ -464,12 +461,10 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
464461
* different link partner.
465462
*/
466463
ret_val = e1000e_config_fc_after_link_up(hw);
467-
if (ret_val) {
464+
if (ret_val)
468465
e_dbg("Error configuring flow control\n");
469-
return ret_val;
470-
}
471466

472-
return 1;
467+
return ret_val;
473468
}
474469

475470
/**

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5089,7 +5089,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter)
50895089
case e1000_media_type_copper:
50905090
if (hw->mac.get_link_status) {
50915091
ret_val = hw->mac.ops.check_for_link(hw);
5092-
link_active = ret_val > 0;
5092+
link_active = !hw->mac.get_link_status;
50935093
} else {
50945094
link_active = true;
50955095
}

0 commit comments

Comments
 (0)