Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3716132imu; Tue, 18 Dec 2018 03:03:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/XmN5h0hQQ/Cko6xoBf16vN/X7WS3f5QtLH6jMSUtk4Qy2UaG1jcPFWfKSomGVO8Lh1i57J X-Received: by 2002:a63:e20a:: with SMTP id q10mr14934002pgh.206.1545131014816; Tue, 18 Dec 2018 03:03:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545131014; cv=none; d=google.com; s=arc-20160816; b=ulmIRHhHL4ihnLx7N/9VLtJjMXBI6Xb9pIErUnut5ni2SRTydthApREQpLYi1tyyq/ 1wKeehdTGSou9IzhzMXHcqi5TPSvbZVDv/mnpru8YBztFv/r+cXPTFwYAlv6VXrrt+Oi ysTsowu1LAXyylfkIu1+w8a5mL0VHjiWTW2Z9oahFy8zgQZKkgZG4GV9AvG/7pTzSUYE ptTpkJLH7SGchPNMqyCPMAJzbaRVCSdV0UHpARCNMnF1+f5pWMCR9JDkPqTguo3jl6qA OGmnxp4nKQRv2v5PXdMFCMYE3Pdn6xXB7+I8fQgnq+NI8B7+eXaZNlLBXowHl51M/ZUx MysA== 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; bh=WLL9zgnI/YuPrdVCwANQ7RLuUyUd1uABjp6Jlvu2l6o=; b=mOk0FtAKX/+nOQu9UlI8UReEeWP9ZaX8I0Rrcp1wWn+A6jE6Q87ZD1QFuoXsgQEiE+ YGvo8LGgf22Fw5pFjqTE2oXu/m3w2hpTSN/BeBORGdwVFBy2i/eiclTz1T/ZBMnLml7k 8cSTBVeFlVHsIWaagZfAReZbEJ4QQNrtPVKMcEAINJ/0EfrlwSxyLTjRrg3wOLlyXYHw kQFggyI0E/J6R9FcozLV7oyU/NwO01c+HWrieFa7bIEp7u74AioBKG4XsrsUpNtpPlkf SScFT0zEt86rTQhqll49XX7pwo/8jVAHECYqecqJlGtekO7pee0vGj0Qq8+md1O2mxah JAIQ== 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 h31si13360809pgl.482.2018.12.18.03.03.16; Tue, 18 Dec 2018 03:03:34 -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 S1726793AbeLRLCP (ORCPT + 99 others); Tue, 18 Dec 2018 06:02:15 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:38225 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726690AbeLRLCI (ORCPT ); Tue, 18 Dec 2018 06:02:08 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id E1E91213A8E40; Tue, 18 Dec 2018 19:02:03 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.408.0; Tue, 18 Dec 2018 19:01:58 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH net-next 09/12] net: hns3: synchronize speed and duplex from phy when phy link up Date: Tue, 18 Dec 2018 19:37:56 +0800 Message-ID: <1545133079-79605-10-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1545133079-79605-1-git-send-email-lipeng321@huawei.com> References: <1545133079-79605-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 Driver calls phy_connect_direct and registers hclge_mac_adjust_link to synchronize mac speed and duplex from phy. It is better to synchronize mac speed and duplex from phy when phy link up. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c index d8ef436..dabb843 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c @@ -179,6 +179,10 @@ static void hclge_mac_adjust_link(struct net_device *netdev) int duplex, speed; int ret; + /* When phy link down, do nothing */ + if (netdev->phydev->link == 0) + return; + speed = netdev->phydev->speed; duplex = netdev->phydev->duplex; -- 1.9.1