Received: by 10.192.165.156 with SMTP id m28csp73441imm; Tue, 10 Apr 2018 16:43:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/a5y1snL0DfKDwNo8+df7PIBEg3r1MQiWqeQ1f3PsRrv/LcwLL6WpYQM0lOv22ImSw2+SH X-Received: by 2002:a17:902:aa0b:: with SMTP id be11-v6mr2477365plb.36.1523403785435; Tue, 10 Apr 2018 16:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523403785; cv=none; d=google.com; s=arc-20160816; b=0OMCFHElUV3rQEUx0eR2xsruYqKD5YpOQ6w4Cthsv/N/UzcmvI9JCohXPxiuYfQoIo Uy7kCwYe5uFkVAmEsDYXheRN53flAK9s03g4ffMg0M/87m2YIg/h4Q8/A9HW4X9BBl4P a0zqS9JWyLz1GccMDlzo34s/d54mEBa+0hEBDMjq6XdWoUBdHaXIEKyv0iEGRCnGHiEF 13M+xyLyQBOySJ1HLpL6SvOuA71VDPWfMWOEhvX7Ti8lIubwQdXh4qJCwAq6eNN5zqgv PtiFu9xj3XGOWlpoWppOpS4ZtsaUPK3okPX8wjDwYiGTs+udxCetVhgvO79v1gTiSLV6 w/oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9kzKEq3hY9krkM4+yYmMEmiTY/UYkpGZsJNELkSgF9U=; b=hg4I+k33K2PwbJ3/FfAEVE2g7TyM0ZrciIDYolRp9jMHrW4AcIxC9sdxQW0oW4Nb5r IRaD9rpMkP4NMzbt87gAyBa4Aej7F1/IkEWfw3Xx4Smi0SHk0F4xo9LoIi3/6qHTa7uE 1+agrFfzlhRAZ0zFAHrK/UDQAP29sGx/WwYeBDHxJTMX1tqLgM1zcX9e+MSiQLnrluY0 RYpCzr+ANhnxC7zj96HsXXQL12gi03uNzB+OP6XLzbWa7hzXgWbGZYiMT1xxO34rcP9d uzmycTGCEfQtWijP1pUyK2uLgDJtXFNjQanY9Tzn80kZV7Evk9wzi+NJYzVId9rgd/Bu Ffow== 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 r1si2839758pfb.247.2018.04.10.16.42.28; Tue, 10 Apr 2018 16:43:05 -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 S1755024AbeDJXiF (ORCPT + 99 others); Tue, 10 Apr 2018 19:38:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37756 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753459AbeDJW1J (ORCPT ); Tue, 10 Apr 2018 18:27:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0544ECE5; Tue, 10 Apr 2018 22:27:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fuyun Liang , Peng Li , "David S. Miller" , Sasha Levin Subject: [PATCH 4.15 014/168] net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg Date: Wed, 11 Apr 2018 00:22:36 +0200 Message-Id: <20180410212800.824613837@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Fuyun Liang [ Upstream commit 27b5bf49f0924fd62d2b1ef8467b40773973da34 ] When phy exists, we use the value of phydev.autoneg to represent the auto-negotiation state of hardware. Otherwise, we use the value of mac.autoneg to represent it. This patch fixes for getting a error value of auto-negotiation state in hclge_get_autoneg(). Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2189,6 +2189,10 @@ static int hclge_get_autoneg(struct hnae { struct hclge_vport *vport = hclge_get_vport(handle); struct hclge_dev *hdev = vport->back; + struct phy_device *phydev = hdev->hw.mac.phydev; + + if (phydev) + return phydev->autoneg; hclge_query_autoneg_result(hdev);