Received: by 10.223.185.116 with SMTP id b49csp6378390wrg; Wed, 28 Feb 2018 08:26:06 -0800 (PST) X-Google-Smtp-Source: AH8x225eZhozFX81nHtsRrdNlMlPcVX1pxO7vKqmyrY3hrX2SqYQ0NQVgYv1TMC6hQKPIJwygPUx X-Received: by 10.99.53.193 with SMTP id c184mr14395327pga.180.1519835166446; Wed, 28 Feb 2018 08:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519835166; cv=none; d=google.com; s=arc-20160816; b=U3lCY62jfa653mPEuhF4nJ/Dn2d0ss5+vceK6MbttoE/HD+J8KBFEZ8Cd9U8VV22Cs fxy/IqcBvQheAffszdevVS/w8sfe1ewwK5WPbl5SGu8WoKzwUSuWT4UQCkPO4GNRPm/2 Y9kuk2NCBqUroO8toBCOn5YXOI/p7TMGD1MzLl7BKNhjRvzYBal2pQE6Cmntg8sL5tqX F/It/iIiQB/yb7jiA7cqi7Z5npFwD9fFAVY9WBsDRhvp1j3ccZqNGmRiYa9IPXxyiCz8 h9tu09j7+35xPtK6LwC0wTfAyciYwnBlu/0I1Tz0p2vkJnhewe8eeXSgMD8rqrjhIkKz PczQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=hUyS4dj3Vwdgd+IELcMx5iExeeLMRGrrBjkd30Q+nQ0=; b=L5XHF0M9RJRXayCuUq3JR0JqzMhLWyEXqiNSJlsg36F5jwZMI5qfPEqOP7rH6B23Wu xX4j4VuhF0m8l9BJ01u31TpZFWyhtWqMdJuoShawoN6v16ukI7btn4UHtMM17b+w2dRT W8yVUyeR7IGi6FwIg9qOP4WBhaedXJdH2n/1KXlJVv+nWlS9pNm2a/M0pgYbmw3710Wh eAVBgkOluHgf66ntIW+kr6PHEOkPLr6Z3wDRV1NuWz8jqlsWaTzJ1sBq2JsBAbK/54cc VFvMmr450q0TgWo2MDzkfHYzmvXAzHns7pkz5jGb7/vs9coZ3Yzv8n8ESSlD1oBBhmpi Qbgg== 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 s12si1192815pgr.762.2018.02.28.08.25.51; Wed, 28 Feb 2018 08:26:06 -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 S935133AbeB1QU3 (ORCPT + 99 others); Wed, 28 Feb 2018 11:20:29 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35351 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935122AbeB1QU1 (ORCPT ); Wed, 28 Feb 2018 11:20:27 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yr-0006Xl-Ao; Wed, 28 Feb 2018 15:22:29 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yi-0000B1-8S; Wed, 28 Feb 2018 15:22:20 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Jeff Kirsher" , "Christian Hesse" , "Aaron Brown" , "Gabriel C" , "Benjamin Poirier" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 158/254] e1000e: Fix e1000_check_for_copper_link_ich8lan return value. In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Benjamin Poirier commit 4110e02eb45ea447ec6f5459c9934de0a273fb91 upstream. e1000e_check_for_copper_link() and e1000_check_for_copper_link_ich8lan() are the two functions that may be assigned to mac.ops.check_for_link when phy.media_type == e1000_media_type_copper. Commit 19110cfbb34d ("e1000e: Separate signaling for link check/link up") changed the meaning of the return value of check_for_link for copper media but only adjusted the first function. This patch adjusts the second function likewise. Reported-by: Christian Hesse Reported-by: Gabriel C Link: https://bugzilla.kernel.org/show_bug.cgi?id=198047 Fixes: 19110cfbb34d ("e1000e: Separate signaling for link check/link up") Signed-off-by: Benjamin Poirier Tested-by: Aaron Brown Tested-by: Christian Hesse Signed-off-by: Jeff Kirsher Signed-off-by: Ben Hutchings --- drivers/net/ethernet/intel/e1000e/ich8lan.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c @@ -1300,6 +1300,9 @@ 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) { @@ -1314,7 +1317,7 @@ static s32 e1000_check_for_copper_link_i * Change or Rx Sequence Error interrupt. */ if (!mac->get_link_status) - return 0; + return 1; /* First we want to see if the MII Status Register reports * link. If so, then we want to get the current speed/duplex @@ -1453,10 +1456,12 @@ 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 ret_val; + return 1; } static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)