summary refs log tree commit diff
path: root/drivers/net/ethernet/hisilicon
diff options
context:
space:
mode:
authorDaode Huang <huangdaode@hisilicon.com>2016-11-09 18:13:49 +0000
committerDavid S. Miller <davem@davemloft.net>2016-11-10 11:45:37 -0500
commitda2ef1e5585bc733c4cccee8390259abeb27f0bf (patch)
tree15ad8a8e45fbfeb607efd9f2432ded3cc7f9f68e /drivers/net/ethernet/hisilicon
parent2e7c80577e40f0968840455d7cff613c2ded316b (diff)
downloadlinux-da2ef1e5585bc733c4cccee8390259abeb27f0bf.tar.gz
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: Jinchuang Tian <tianjinchuang1@huawei.com>
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Reviewed-by: lipeng <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon')
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_ethtool.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
index 87d5c94b2810..3ac2183dbd21 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
@@ -1178,7 +1178,8 @@ static int hns_nic_nway_reset(struct net_device *netdev)
 	struct phy_device *phy = netdev->phydev;
 
 	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);
 	}