aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
diff options
context:
space:
mode:
authorPeng Li <lipeng321@huawei.com>2018-12-18 19:37:56 +0800
committerDavid S. Miller <davem@davemloft.net>2018-12-18 12:01:01 -0800
commit0ad5ea5dbd6cb1e62bac547db5e61bab15af4f44 (patch)
tree184b9b083d42f7f817e9cd96a3c1fef5aee2f799 /drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
parentnet: hns3: remove 1000M/half support of phy (diff)
downloadlinux-dev-0ad5ea5dbd6cb1e62bac547db5e61bab15af4f44.tar.xz
linux-dev-0ad5ea5dbd6cb1e62bac547db5e61bab15af4f44.zip
net: hns3: synchronize speed and duplex from phy when phy link up
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 <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
index d8ef436ab2b9..dabb8437f8dc 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;