Return-Path: Received: from mail-co1nam03on0121.outbound.protection.outlook.com ([104.47.40.121]:17856 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032098AbeCAP3k (ORCPT ); Thu, 1 Mar 2018 10:29:40 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Benjamin Poirier , Jeff Kirsher , Sasha Levin Subject: [added to the 4.1 stable tree] e1000e: Fix e1000_check_for_copper_link_ich8lan return value. Date: Thu, 1 Mar 2018 15:24:12 +0000 Message-ID: <20180301152116.1486-168-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Benjamin Poirier This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 4110e02eb45ea447ec6f5459c9934de0a273fb91 ] 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 =3D=3D 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=3D198047 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: Sasha Levin --- drivers/net/ethernet/intel/e1000e/ich8lan.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethe= rnet/intel/e1000e/ich8lan.c index e2498dbf3c3b..5e63a8931f2e 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c @@ -1345,6 +1345,9 @@ 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 register= s * to get the current speed/duplex if link exists. + * + * Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (li= nk + * up). **/ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) { @@ -1360,7 +1363,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 0; + return 1; =20 /* First we want to see if the MII Status Register reports * link. If so, then we want to get the current speed/duplex @@ -1519,10 +1522,12 @@ static s32 e1000_check_for_copper_link_ich8lan(stru= ct e1000_hw *hw) * different link partner. */ ret_val =3D e1000e_config_fc_after_link_up(hw); - if (ret_val) + if (ret_val) { e_dbg("Error configuring flow control\n"); + return ret_val; + } =20 - return ret_val; + return 1; } =20 static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) --=20 2.14.1