Received: by 10.223.164.202 with SMTP id h10csp1194722wrb; Tue, 7 Nov 2017 23:53:20 -0800 (PST) X-Google-Smtp-Source: ABhQp+T7VZ0531dESJg7vp+DvFwy1mf4rUJ4GjKEU5I5CBTXIF1jRC37SMv7SfrO7EFukowmv83e X-Received: by 10.84.235.201 with SMTP id m9mr1416366plt.94.1510127600835; Tue, 07 Nov 2017 23:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510127600; cv=none; d=google.com; s=arc-20160816; b=s65y4Xq7L1FaVxfdxv9FptYY1YwSA6TdW1wMFOckp0mYrhdIPOZnCZNynUVIalPDfA MxpDpztt1ppBRo3j9TxMkKTBu5ytvBkF6V4/b7KINtULPgCIDF4LSs/QpNvyJxg4uZjI Xv5sf7nn/yd313idk3xEXPidWhtaEpY8SdSElwHFm6h1Lar1PhQMxxVO1AvV961RFr0u QjhYvsIZdKpJuPiJlHxC1OXvibuQrIOBgnxtW2tBgO+SwOTK9jjzRQDP2u6WlWeVYHRd kr0vgoiUF3imkk5UYfpw1Mp7xJ1FLkHQqqcYCMhJmK28uRtXY+IVGzlOQzOnXyl5dpiH gMMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=0FzVtmdApZS90oaIObqj4SilCJorh3qrPva/Tp/SiM8=; b=icOzrD844QvUCSB47KgNkClc1W8bnE0F1mgLOB07xUJhlspFjibIwzZt+tnaEiv5Z0 sej+GDp+Bi6uVlv3JunuP11VY9GvxZXLxAtMrGThvF5fDVUIuBedFbMBUGrY9GkNU3gD 28eeAyy1d7Aca36sC5zpwMS2IWoROld9xEMIAOfL1XBvSG69U0LyBy0vPu0g1TlVn5zl Atu6cVQSBWUEGl04HL6e0cvrAN9E17OQq22UTrJqrOAlWqDkbJ/UvmnaTxNO6NC449Yt +aipaSXpRiZptoupCNBK9RasZidCZqqNLp+uc2m7n7f5muMGdi8LKcJsKfpDuGni2yBL LW4w== 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 u185si3267527pgc.253.2017.11.07.23.53.08; Tue, 07 Nov 2017 23:53:20 -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 S1755898AbdKHHCg (ORCPT + 91 others); Wed, 8 Nov 2017 02:02:36 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10029 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755832AbdKHHCe (ORCPT ); Wed, 8 Nov 2017 02:02:34 -0500 Received: from 172.30.72.60 (EHLO DGGEMS405-HUB.china.huawei.com) ([172.30.72.60]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKN96202; Wed, 08 Nov 2017 15:02:28 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.361.1; Wed, 8 Nov 2017 15:01:59 +0800 From: Lipeng To: CC: , , , , , Subject: [PATCH net-next 2/2] {topost} net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex Date: Wed, 8 Nov 2017 15:31:19 +0800 Message-ID: <1510126279-31751-3-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510126279-31751-1-git-send-email-lipeng321@huawei.com> References: <1510126279-31751-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.5A02AC04.0356,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: dab0f652468e6bf68607faafd9c3cf21 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang When checking whether auto-negotiation is on, driver only needs to check the value of mac.autoneg(SW) directly, and does not need to query it from hardware. Because this value is always synchronized with the auto-negotiation state of hardware. This patch removes mac auto-negotiation state query in hclge_update_speed_duplex(). Fixes: 46a3df9f9718 (net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support) Signed-off-by: Fuyun Liang Signed-off-by: Lipeng --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index c6ba890..781d5a8 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2325,18 +2325,7 @@ static int hclge_update_speed_duplex(struct hclge_dev *hdev) /* get the speed and duplex as autoneg'result from mac cmd when phy * doesn't exit. */ - if (mac.phydev) - return 0; - - /* update mac->antoneg. */ - ret = hclge_query_autoneg_result(hdev); - if (ret) { - dev_err(&hdev->pdev->dev, - "autoneg result query failed %d\n", ret); - return ret; - } - - if (!mac.autoneg) + if (mac.phydev || !mac.autoneg) return 0; ret = hclge_query_mac_an_speed_dup(hdev, &speed, &duplex); -- 1.9.1 From 1583456855780404348@xxx Wed Nov 08 00:48:54 +0000 2017 X-GM-THRID: 1581787391127272624 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread