Skip to content

Commit 455c440

Browse files
321lipengdavem330
authored andcommitted
net: hns: add netif_carrier_off before change speed and duplex
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 31fabbe commit 455c440

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/hisilicon/hns/hns_ethtool.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ static int hns_nic_set_link_ksettings(struct net_device *net_dev,
243243
}
244244

245245
if (h->dev->ops->adjust_link) {
246+
netif_carrier_off(net_dev);
246247
h->dev->ops->adjust_link(h, (int)speed, cmd->base.duplex);
248+
netif_carrier_on(net_dev);
247249
return 0;
248250
}
249251

0 commit comments

Comments
 (0)