diff options
author | Peng Li <lipeng321@huawei.com> | 2018-12-18 19:37:56 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-18 12:01:01 -0800 |
commit | 0ad5ea5dbd6cb1e62bac547db5e61bab15af4f44 (patch) | |
tree | 184b9b083d42f7f817e9cd96a3c1fef5aee2f799 /drivers/net | |
parent | 8362089d787724bb252f13f942921051943369c7 (diff) | |
download | linux-0ad5ea5dbd6cb1e62bac547db5e61bab15af4f44.tar.bz2 |
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')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 4 |
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; |