Received: by 10.213.65.68 with SMTP id h4csp1616188imn; Mon, 19 Mar 2018 08:50:30 -0700 (PDT) X-Google-Smtp-Source: AG47ELunGXwJC+MN/IU08JtfywAJmsd4HnHTh/d9k0ElPUjNWXBAFAFZ6ayQpgrbvoemNFh7Jr+E X-Received: by 10.98.82.144 with SMTP id g138mr10531509pfb.239.1521474630188; Mon, 19 Mar 2018 08:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521474630; cv=none; d=google.com; s=arc-20160816; b=EfdZ1eyAgrZakWxcXuh5XDnFTr45YhcBErJItnobDdjnM825oTIJko0cBNsd5aFH+e Cj7H8p0rOHfeqdTkF1b3UN3ZQEQY9E6Ri5Bxk9NOz/3vk9fDUx9PmhC8sHgmcf2Ti+y7 8ZiDgLL90WCbCFxQZdLS0UuMru3pyzURN96D9lhowWeazwWXKuV9SoEB8guFbfOi70UO nZ5Q2nIhd7sCLuZJkET3Vr5pKdxOTRmjrzNR1JQzanl3KrMDpjWJJQok1llgim4svkql 4RqNqOXrGmGJQxZ1ZY2N9h9x2DpD4jiNjdEXBEvUHSWuy2FVtWowu0uMsASURs8qQlZR 35Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=WTpJM7PJ41R+sdlpTRgoiRqub7yEydE/M74x4QHFbeo=; b=vpEKTxjTBO2jTkyAIoMwD8s5MO16eKfZbeuOQp7hmSTGSyn65oUPTzGyW6QQa2mOPV t0fSZKfkPY5mpLieHjqvBG/Tz8ryM6ZzOLuirgHPP8Gt9WRi2qLym+vu0znxY09wrCyg bv8jUNd0+f8L0j6QTLFGFTnrCEb4Btpj+X9oEKzr5rOpy0aXZD4P+LG6i6sgr644Vd4B nnIrGnE5kQ42LXiDzDB3FLmAFGSpNwCKV3rkby09/EUhJN36zBG7hhE7p2MgRRbJXn7B G7ya8qyWEWGOkl/8YBg5LfzX0lbPHYMa4sLi754o335u64+Uo5lSyPwxLpP821H1DwFU xSiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Ctp6udjm; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z62si133638pgd.819.2018.03.19.08.50.13; Mon, 19 Mar 2018 08:50:30 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Ctp6udjm; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933518AbeCSPrl (ORCPT + 99 others); Mon, 19 Mar 2018 11:47:41 -0400 Received: from mail-cys01nam02on0128.outbound.protection.outlook.com ([104.47.37.128]:6976 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932578AbeCSPrT (ORCPT ); Mon, 19 Mar 2018 11:47:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=WTpJM7PJ41R+sdlpTRgoiRqub7yEydE/M74x4QHFbeo=; b=Ctp6udjmwq6AyiTl/ym+oZ7NH3O3aibsJpo/hUZ+dYwHNXl8Ahm94+3yGbsPZT0BuXLncjzMBJyuCdwlVRNnNDzWslP4JfnS9zgf2Ym6RfhOPdNXiXJoRZWgRhForOYYiLghfO5bDGNiye2e5hN9ycMss8Xu7yLgeTFc0c/bhEA= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1013.namprd21.prod.outlook.com (52.132.133.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:47:12 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:47:12 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Fuyun Liang , Peng Li , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 014/124] net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg Thread-Topic: [PATCH AUTOSEL for 4.15 014/124] net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg Thread-Index: AQHTv5mMvxU06Y0p6EahUVaoFrFv/A== Date: Mon, 19 Mar 2018 15:47:12 +0000 Message-ID: <20180319154645.11350-14-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1013;7:Mhl02+iG009m/7NasDebRN3yNjY5MnFfbaRVyDnjM4bDbTnbTc5xqkfW6r5rxVeWnXBHYr5NAoSmPqtLKKoJgGj6NIjmlvHV18QCapn5FTJA785seoGudaCCv483kM3+LKsc3zCC6aCCJOPiiUsm0qAipi97HXn34rWzcm+9SxSbtlI1Zw+Ke0SujCknlIwmo/LipAP4ODDvV3y+pmUrFSx7U1mEcjw4KdTGwUJ+e2JBYU2hmX21zvCVoShZ16j8;20:lbHfj9yIR4m0Zx0uFqyMneNSRVEBG/IOo7zdSLhrMVZyuiUkoQ09PWrbstMM8U+oyh7rK3EhDBABvubBx9sgNUXWC2xQbP1vYYTps59SWuKvONiDbsDwqs4Zzj84d4CWp864QzFZE77rxWh8/UkJjH0ti5lpey/QILgVjHj8oyU= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 7470cffe-c319-4783-0bd2-08d58db0aec6 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1013; x-ms-traffictypediagnostic: DM5PR2101MB1013: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(50582790962513); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231221)(944501300)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB1013;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1013; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(346002)(376002)(39380400002)(189003)(199004)(86612001)(316002)(26005)(72206003)(4326008)(25786009)(110136005)(10290500003)(86362001)(54906003)(53936002)(36756003)(107886003)(3280700002)(14454004)(22452003)(6506007)(5660300001)(68736007)(99286004)(186003)(478600001)(76176011)(2950100002)(10090500001)(102836004)(6116002)(5250100002)(2501003)(97736004)(3660700001)(106356001)(81156014)(81166006)(8676002)(8936002)(7736002)(305945005)(2900100001)(105586002)(3846002)(1076002)(66066001)(6436002)(2906002)(6512007)(6486002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1013;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: eWTdFyEj5XYvSRZ5JlQIqy15LmOpncUHIY7Cau2qpBYXIq11GLITBzNIJ79cniGu8P+A5FsYV9EIf0ETen4ShuTbbTLC+4qZ0AJurq8dmRoTfLICeFKkmW5j3lvfLfpDGSPeNllu3kHO89RxdPxlKnSB2aA+mPzTx/sC5lozcS7pbpNU7EHQAJEXXql4QCr5KuH3TDUZd48Pvo6sMOKDbyc9j4ilrmVpyuDGsSWYg+A45B6K2vRujhfaegOaDfH9ktSxHKXHpFHGXG8Q+BNyIyLU7V+Ft30ENCloxM3Svv2xwKXj2QZtomByLSE6ZEiFMUd3pIPtWWexPOCGhOCdBg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7470cffe-c319-4783-0bd2-08d58db0aec6 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:47:12.7507 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1013 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 & Compatibili= ty Layer Support") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/driv= ers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 59ed806a52c3..3a3c7fe50e13 100644 --- 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 hnae3_handle *ha= ndle) { struct hclge_vport *vport =3D hclge_get_vport(handle); struct hclge_dev *hdev =3D vport->back; + struct phy_device *phydev =3D hdev->hw.mac.phydev; + + if (phydev) + return phydev->autoneg; =20 hclge_query_autoneg_result(hdev); =20 --=20 2.14.1