Received: by 10.223.176.46 with SMTP id f43csp444758wra; Fri, 26 Jan 2018 01:14:44 -0800 (PST) X-Google-Smtp-Source: AH8x2248A+tD89f5LXerPXrkDyvlNxc8n5mZKH0QTKF7cdg0YFzkmskqqx3biRDZSb2XfZ5ZOHEw X-Received: by 2002:a17:902:507:: with SMTP id 7-v6mr12280224plf.0.1516958084578; Fri, 26 Jan 2018 01:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516958084; cv=none; d=google.com; s=arc-20160816; b=NNeiPDgPh6p2n2O1n5iowIlVoN/SLxq1FvsUit3B7V1mHu2kdY3rfCzNM6H/II9YeJ LEvRsn4XEuwYUfcgEvb8/1+2NlqwEadwd73wfVrCyhHc595ML8o+b9f7nqvPlcoWlnox 6NoffGHN+HHkIRhWtCqJ7mr0KXMKfPb0sKM6zo3YzF1sVGjbKfqbFFpCP2KzMqhrmjf7 V1xBeQ6qlK0lkKXJv7UKp5M9Coum+krqVC3R01IP13JQ5BAmkagegUIKQXgckyHWHaOG IEgXRnNv5FJ1h/QRTs37PP3BaUBS3YxI2TSWJOS31jMp1/idPzyTr9tRjjz3IMW/N9Qt Bt2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=t3DI0dYExeEBqYiMD/AW9Gwc+PwzUywvgCN5ikj7J54=; b=KKt4P2MGYZ2k9Ag1ujWU2Krcd3sLoBd+WCA8LqYy67e5E+yg/fQkLwzBenDnUT/W8v yJS/zJPetIoWeEf/m7acQi22OjQPVbzeNTmAspKZo7nZdrM3kGjwSJjmWZ4QN/cNbk7C x8TRs7lR4Jk5x+vGREdYEiRfP7rRfX0XJ2h0WR5nKMY3SagmBz4pn/dql0irllvWE6Nx zIOQh2nTsGxYDDZGTnohhazGRbaWoOsXE2ZEb5v/FWqYjmHuisaqaBripxkSnesBioQU W3eHvazLnerU00KmLE8grnojdpUCEP2ONg66kjsewifdoi7z7gmROyuE7U39YlUqqLix aIEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12-v6si3459030pln.126.2018.01.26.01.14.30; Fri, 26 Jan 2018 01:14:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752819AbeAZJNj (ORCPT + 99 others); Fri, 26 Jan 2018 04:13:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:33558 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752402AbeAZJM7 (ORCPT ); Fri, 26 Jan 2018 04:12:59 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C1C0EAE06; Fri, 26 Jan 2018 09:12:57 +0000 (UTC) From: Benjamin Poirier To: Jeff Kirsher Cc: Alexander Duyck , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] Revert "e1000e: Separate signaling for link check/link up" Date: Fri, 26 Jan 2018 18:12:35 +0900 Message-Id: <20180126091236.13044-3-bpoirier@suse.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180126091236.13044-1-bpoirier@suse.com> References: <20180126091236.13044-1-bpoirier@suse.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 19110cfbb34d4af0cdfe14cd243f3b09dc95b013. This reverts commit 4110e02eb45ea447ec6f5459c9934de0a273fb91. ... because they cause an extra 2s delay for the link to come up when autoneg is off. After reverting, the race condition described in the log of commit 19110cfbb34d ("e1000e: Separate signaling for link check/link up") is reintroduced. It may still be triggered by LSC events but this should not result in link flap. It may no longer be triggered by RXO events because commit 4aea7a5c5e94 ("e1000e: Avoid receiver overrun interrupt bursts") restored reading icr in the Other handler. As discussed, the driver should be in "maintenance mode". In the interest of stability, revert to the original code as much as possible instead of a half-baked solution. Link: https://www.spinics.net/lists/netdev/msg479923.html Signed-off-by: Benjamin Poirier --- drivers/net/ethernet/intel/e1000e/ich8lan.c | 11 +++-------- drivers/net/ethernet/intel/e1000e/mac.c | 11 +++-------- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 31277d3bb7dc..d6d4ed7acf03 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c @@ -1367,9 +1367,6 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) * Checks to see of the link status of the hardware has changed. If a * change in link status has been detected, then we read the PHY registers * to get the current speed/duplex if link exists. - * - * Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link - * up). **/ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) { @@ -1385,7 +1382,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) * Change or Rx Sequence Error interrupt. */ if (!mac->get_link_status) - return 1; + return 0; /* First we want to see if the MII Status Register reports * link. If so, then we want to get the current speed/duplex @@ -1616,12 +1613,10 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) * different link partner. */ ret_val = e1000e_config_fc_after_link_up(hw); - if (ret_val) { + if (ret_val) e_dbg("Error configuring flow control\n"); - return ret_val; - } - return 1; + return ret_val; } static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c index f457c5703d0c..b322011ec282 100644 --- a/drivers/net/ethernet/intel/e1000e/mac.c +++ b/drivers/net/ethernet/intel/e1000e/mac.c @@ -410,9 +410,6 @@ void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw) * Checks to see of the link status of the hardware has changed. If a * change in link status has been detected, then we read the PHY registers * to get the current speed/duplex if link exists. - * - * Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link - * up). **/ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) { @@ -426,7 +423,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) * Change or Rx Sequence Error interrupt. */ if (!mac->get_link_status) - return 1; + return 0; /* First we want to see if the MII Status Register reports * link. If so, then we want to get the current speed/duplex @@ -464,12 +461,10 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) * different link partner. */ ret_val = e1000e_config_fc_after_link_up(hw); - if (ret_val) { + if (ret_val) e_dbg("Error configuring flow control\n"); - return ret_val; - } - return 1; + return ret_val; } /** diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 398e940436f8..ed103b9a8d3a 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -5091,7 +5091,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter) case e1000_media_type_copper: if (hw->mac.get_link_status) { ret_val = hw->mac.ops.check_for_link(hw); - link_active = ret_val > 0; + link_active = !hw->mac.get_link_status; } else { link_active = true; } -- 2.15.1