Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2476403imm; Mon, 24 Sep 2018 05:09:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV62bnZ8zqJ5FtTV99qOW4b3SjuDQ6ifz3HvjMbkLUOeOQRSxih+TNrxyilYLo9/KjT83ll4a X-Received: by 2002:a17:902:274a:: with SMTP id j10-v6mr10659350plg.152.1537790983396; Mon, 24 Sep 2018 05:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537790983; cv=none; d=google.com; s=arc-20160816; b=byYIUJdVqkg7jTLEC8mzPYWsNWeOou0585LSGXUmq4Qj8jBjwPGhymLjRn/GgTrgwe NTaOjnIntO9kWm1QK1UqwkBlSq/kulW9pstargypZxNKeG6BqWYS3bs995fiRxhxpxVD ExEzDDe6+zzpwF8UsR6ykNKyIyU8kPBnuQfSLQkc7KDjMQYn9+x4bbIKBOg8NBb7JuHv m66sA+tqAkvFQQF1iPvrCWcEHmpxX76j7Db12XYn5k2OuTnwiVh5fmsc/h6O8Ralprqr 4ADcSpHZ1XucfP6gbNDU7mr9HLZec0FvjN8tZxr8IbfEDdMmnYWuG97bJNTImUvUnFBu bcUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=xdpJtReMmOMSPuPkP7CU+PxFWAgKX3EVzEO7nc7rA2Y=; b=ZTWdGNZ9J2PqfOgEk8ddkGe8hif5eSTbthwJ8NhO2w+RHUhiBkFgj44Ulg/gt/9NQ5 5CLxujLEcMIaKme/kjoxYEz2BuJEXjfdAGFX+Fx7qg692QsjhxCgYsV8pnOGLjNEnxhf SEGbGXQJsKvwJAtV7PTAfr57z2BPZfTKWxUuQYp3wEPOfXSvwvdcTTG4DqOW8Liy7Ha6 7+2QUJzltoI0iTqVCYk6HRGZlaoCpFQNEE842OJyVR5sCUT2ljp7VcmRKY7uDq2DWrkq HdMBI0tUsGM/sKpp9NoZfNk/0GsAaIMROYBwBs/TVciwt2AHRFcAju9a9y95tQKwz/8h 9nvg== 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 y2-v6si12910694plt.112.2018.09.24.05.09.28; Mon, 24 Sep 2018 05:09:43 -0700 (PDT) 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 S1731360AbeIXSKQ (ORCPT + 99 others); Mon, 24 Sep 2018 14:10:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54812 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729112AbeIXSKM (ORCPT ); Mon, 24 Sep 2018 14:10:12 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CDD751081; Mon, 24 Sep 2018 12:08:21 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Poirier , Alexander Duyck , Aaron Brown , Jeff Kirsher , Yanhui He , Ben Hutchings Subject: [PATCH 4.9 109/111] Revert "e1000e: Separate signaling for link check/link up" Date: Mon, 24 Sep 2018 13:53:16 +0200 Message-Id: <20180924113116.076037057@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.337261320@linuxfoundation.org> References: <20180924113103.337261320@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Benjamin Poirier commit 3016e0a0c91246e55418825ba9aae271be267522 upstream. This reverts commit 19110cfbb34d4af0cdfe14cd243f3b09dc95b013. This reverts commit 4110e02eb45ea447ec6f5459c9934de0a273fb91. This reverts commit d3604515c9eda464a92e8e67aae82dfe07fe3c98. Commit 19110cfbb34d ("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 19110cfbb34d ("e1000e: Separate signaling for link check/link up") and its followups. After reverting, the race condition described in the log of commit 19110cfbb34d 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 4aea7a5c5e94 ("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 Acked-by: Alexander Duyck Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher Cc: Yanhui He Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/e1000e/ich8lan.c | 13 ++++--------- drivers/net/ethernet/intel/e1000e/mac.c | 13 ++++--------- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- 3 files changed, 9 insertions(+), 19 deletions(-) --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c @@ -1364,9 +1364,6 @@ out: * 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) { @@ -1382,7 +1379,7 @@ static s32 e1000_check_for_copper_link_i * 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 @@ -1600,7 +1597,7 @@ static s32 e1000_check_for_copper_link_i * we have already determined whether we have link or not. */ if (!mac->autoneg) - return 1; + return -E1000_ERR_CONFIG; /* Auto-Neg is enabled. Auto Speed Detection takes care * of MAC speed/duplex configuration. So we only need to @@ -1614,12 +1611,10 @@ static s32 e1000_check_for_copper_link_i * 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) --- 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 e * 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 * 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 @@ -450,7 +447,7 @@ s32 e1000e_check_for_copper_link(struct * we have already determined whether we have link or not. */ if (!mac->autoneg) - return 1; + return -E1000_ERR_CONFIG; /* Auto-Neg is enabled. Auto Speed Detection takes care * of MAC speed/duplex configuration. So we only need to @@ -464,12 +461,10 @@ s32 e1000e_check_for_copper_link(struct * 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; } /** --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -5074,7 +5074,7 @@ static bool e1000e_has_link(struct e1000 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; }