Received: by 10.223.164.202 with SMTP id h10csp1196177wrb; Tue, 7 Nov 2017 23:55:17 -0800 (PST) X-Google-Smtp-Source: ABhQp+TKGi7Zotb/XaAWOj9WkXwJLda2sb5ndMzrP9XpTgfE4uln7SDIPwajNTa7bdZyhlPnCcen X-Received: by 10.84.234.198 with SMTP id i6mr1470137plt.410.1510127717224; Tue, 07 Nov 2017 23:55:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510127717; cv=none; d=google.com; s=arc-20160816; b=HjeEdNaIKR4U2L0ac7QQiyJsn0gIypaiMCGvqwMjL3OD3OuIYU49tLok64xri3o0gk 9UwshbkY7AQG9d1R+7ohSKuNNKOpACRNeKGlUObSdkGryTg3Ctm+LbVNUidPh6o6Ji0O 8pshAox0ho9lPNLxCwa27NIoyANhs04oNM3lue4VyormgwbWURba8aD7Y+9c4bkHUAEv axuwzhxp6dZWO77fSCUwSo0PnYzykGK9aCtcQaQe76dEFztzoPI0dvpwbn+xW0I1qZiq kR/GNvJdCKHmO8fyw6+8k1Yu/H1umGwSARaDp6iO9d4V8nTfUo1EZkzhaH4rfNDqFrAX N7tg== 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=e0/a0f9JfpCPbfXdyJ9I0pFYLhgjIE3Vzrzs3HCsU3xYjRKjsFJ0ee1/STB0EiJpji 8c8dBqxQf7Czt9qIk1jiL1f/L3l22KKePjYFqUqzP+AVKliPtr1mnZZfF9fXDMpeTOoi PKZqiJc5SaSlELF+POkKrJTXDHafYw+y/maTxKP6uxKWP2BJXqBOKYWSfiITaN3D6lKE 2YA7QJf3jwwaNEsGy7UWgEDzuuTiH38KzBxLMwnkiRJPVVSS8RD9yQsutaxg0+olXYcI zxWLyhBywEAjbYPWUX2R4RHSr6f/AfSzOlNiuV7SScutzpB6sl6KgOgSQENNDYyXlB2j SiSw== 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 9si3417417pfq.164.2017.11.07.23.55.04; Tue, 07 Nov 2017 23:55:17 -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 S932500AbdKHHXY (ORCPT + 91 others); Wed, 8 Nov 2017 02:23:24 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:39123 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932384AbdKHHXW (ORCPT ); Wed, 8 Nov 2017 02:23:22 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 605E150C45075; Wed, 8 Nov 2017 15:23:08 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Wed, 8 Nov 2017 15:23:01 +0800 From: Lipeng To: CC: , , , , , Subject: [PATCH net-next 2/2] net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex Date: Wed, 8 Nov 2017 15:52:23 +0800 Message-ID: <1510127543-34158-3-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510127543-34158-1-git-send-email-lipeng321@huawei.com> References: <1510127543-34158-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 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 1583411081984362228@xxx Tue Nov 07 12:41:21 +0000 2017 X-GM-THRID: 1583407895593019071 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread