Commit da2ef1e5 authored by Daode Huang's avatar Daode Huang Committed by David S. Miller

net: hns: bug fix about restart auto-negotiation

When set auto-negotiation off and duplex half, if run "ethtool -r ethX"
on port with phy, then the port will be failed to work. It should
forbid to start auto-negotiation when auto-negotiate is off. This
patch add the limited condition.
Reported-by: default avatarJinchuang Tian <tianjinchuang1@huawei.com>
Signed-off-by: default avatarDaode Huang <huangdaode@hisilicon.com>
Reviewed-by: default avatarYisen Zhuang <yisen.zhuang@huawei.com>
Reviewed-by: default avatarlipeng <lipeng321@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2e7c8057
...@@ -1178,7 +1178,8 @@ static int hns_nic_nway_reset(struct net_device *netdev) ...@@ -1178,7 +1178,8 @@ static int hns_nic_nway_reset(struct net_device *netdev)
struct phy_device *phy = netdev->phydev; struct phy_device *phy = netdev->phydev;
if (netif_running(netdev)) { if (netif_running(netdev)) {
if (phy) /* if autoneg is disabled, don't restart auto-negotiation */
if (phy && phy->autoneg == AUTONEG_ENABLE)
ret = genphy_restart_aneg(phy); ret = genphy_restart_aneg(phy);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment