summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManfred Rudigier <manfred.rudigier@omicronenergy.com>2019-08-15 13:55:20 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-12 19:21:18 +0100
commit4a05571772cc9a002542ff14a1adff6908a851ee (patch)
tree8154ca6e4ad1d8bb23677ada871e97f5de9b3043
parent1baab8352d80e7ac2b2d2785b7962c6af10c633c (diff)
downloadlinux-stable-4a05571772cc9a002542ff14a1adff6908a851ee.tar.gz
linux-stable-4a05571772cc9a002542ff14a1adff6908a851ee.tar.bz2
linux-stable-4a05571772cc9a002542ff14a1adff6908a851ee.zip
igb: Fix constant media auto sense switching when no cable is connected
[ Upstream commit 8d5cfd7f76a2414e23c74bb8858af7540365d985 ] At least on the i350 there is an annoying behavior that is maybe also present on 82580 devices, but was probably not noticed yet as MAS is not widely used. If no cable is connected on both fiber/copper ports the media auto sense code will constantly swap between them as part of the watchdog task and produce many unnecessary kernel log messages. The swap code responsible for this behavior (switching to fiber) should not be executed if the current media type is copper and there is no signal detected on the fiber port. In this case we can safely wait until the AUTOSENSE_EN bit is cleared. Signed-off-by: Manfred Rudigier <manfred.rudigier@omicronenergy.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index ab76a5f77cd0..36db874f3c92 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2064,7 +2064,8 @@ static void igb_check_swap_media(struct igb_adapter *adapter)
if ((hw->phy.media_type == e1000_media_type_copper) &&
(!(connsw & E1000_CONNSW_AUTOSENSE_EN))) {
swap_now = true;
- } else if (!(connsw & E1000_CONNSW_SERDESD)) {
+ } else if ((hw->phy.media_type != e1000_media_type_copper) &&
+ !(connsw & E1000_CONNSW_SERDESD)) {
/* copper signal takes time to appear */
if (adapter->copper_tries < 4) {
adapter->copper_tries++;