mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
net: hns: add netif_carrier_off before change speed and duplex
[ Upstream commit 455c4401fe ]
If there are packets in hardware when changing the speed
or duplex, it may cause hardware hang up.
This patch adds netif_carrier_off before change speed and
duplex in ethtool_ops.set_link_ksettings, and adds
netif_carrier_on after complete the change.
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7fd11a1ad5
commit
e7577a1f1a
@@ -243,7 +243,9 @@ static int hns_nic_set_link_ksettings(struct net_device *net_dev,
|
||||
}
|
||||
|
||||
if (h->dev->ops->adjust_link) {
|
||||
netif_carrier_off(net_dev);
|
||||
h->dev->ops->adjust_link(h, (int)speed, cmd->base.duplex);
|
||||
netif_carrier_on(net_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user