net: hns: add netif_carrier_off before change speed and duplex
authorPeng Li <lipeng321@huawei.com>
Mon, 27 Aug 2018 01:59:30 +0000 (09:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Oct 2018 06:54:20 +0000 (08:54 +0200)
commite7577a1f1a65956fe6981b97f3002478e293dc8d
treeaf6cedf032222a96384ead96820072b8fff7719a
parent7fd11a1ad542ab719f18e6480e4de4f7aad711eb
net: hns: add netif_carrier_off before change speed and duplex

[ Upstream commit 455c4401fe7a538facaffb35b906ce19f1ece474 ]

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>
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c