Received: by 10.192.165.156 with SMTP id m28csp28218imm; Tue, 10 Apr 2018 15:42:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+epsMDsg0S5Xh81NAOcKgygAqB1N/vNhQFymEheHCKDSfvxoLWleHADndD40pm1A2rf0sB X-Received: by 10.101.91.203 with SMTP id o11mr406794pgr.160.1523400135867; Tue, 10 Apr 2018 15:42:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523400135; cv=none; d=google.com; s=arc-20160816; b=qFOFfLTN70kxlaknAzPwcjs1UMJtXY7JEJMBM/4q0GHQCTaJxxLI7tT+f5JZP16ZWU Xfe1E4cdWmsT/9V9Z3TyJFQBbxyas+ih17SCNTpuetfTavgqj742+UCWmt13bVZEZZqD 5T2sMIlxe+Asfn7a51b0XNaDgd4gqJRnG6wW3fXjQ85Z/cgyAr8oR8a3fTd+4iGCEWVz NGNLBS+ZE0Xz+b8sc57nIFb5K9UbRWV9gNqL4P/Ji1jmufZ/QhK/UbskpSwzFcO+d77a +gNHioqJki2E0UhOgd0vzQYI6RjBvs43Zf6yvOEgW5CeVVl/mpr8j8aY8ErYGoM1nrWa HW7A== 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=+nG5G3jdv55ZqU+o07ZQpbCTFfo/IUbdiP7M3Ijrrk0=; b=APmqPGEKJzEXgmavgprPapHEcq1/8TpSok44fpc4k/2brk3sQCyICC0cqwN1TcpFMi oCR57Lka8TxVEnl1btWWn4y60oE2FQxc0rN8XOnIvYKIdOiVTRMYNuC7aYrwQ6CG6CRq +HXCyViVFCtXgWj/RzDx6+xr1fLlyrw0hDplGhFFayvwXQF3/iqYEZHbQZTJTfLlg6DQ clZaZHwe9+Y0beQNVE9geNl6LZz2yphr7N0v4nUn2+5IeKoqVUIiANuH686gnF4P4ckx PzBowQJ/XqCe1P0E2qXPFLE/cfcDTInyKX5Aiirzbt71DRGBV8ljssuzAn9NV4y9GiHN MM+w== 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 u206si2366633pgb.321.2018.04.10.15.41.39; Tue, 10 Apr 2018 15:42:15 -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 S1755386AbeDJWeI (ORCPT + 99 others); Tue, 10 Apr 2018 18:34:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41604 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755349AbeDJWeF (ORCPT ); Tue, 10 Apr 2018 18:34:05 -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 27FE4D1C; Tue, 10 Apr 2018 22:34:05 +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.14 013/138] net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg Date: Wed, 11 Apr 2018 00:23:23 +0200 Message-Id: <20180410212903.684791911@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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.14-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 @@ -2092,6 +2092,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);