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:53:18 +0000 (08:53 +0200)
commit5640e04fdc59e9c7e5afd153f2079b5b851ada67
tree8ca19b378e327831ac567be27b3e68f74fb97768
parent7c10ec1ddde1cc9f73fc3f8a27d427b59675d08f
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