summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorYonglong Liu <liuyonglong@huawei.com>2018-12-15 11:53:24 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-13 09:51:00 +0100
commitac9ae1930a1b7136d9167373fb19c4c7d05c6c85 (patch)
tree0eae49616001e1be8a20b91a6e1aa244313ef40a /drivers/net
parent1b2f8d7cc1b2a9a6de1ba349a70da0a2496966fa (diff)
net: hns: Clean rx fbd when ae stopped.
[ Upstream commit 31f6b61d810654fb3ef43f4d8afda0f44b142fad ] If there are packets in hardware when changing the speed or duplex, it may cause hardware hang up. This patch adds the code to wait rx fbd clean up when ae stopped. Signed-off-by: Yonglong Liu <liuyonglong@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
index b52029e26d15..ad1779fc410e 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
@@ -379,6 +379,9 @@ static void hns_ae_stop(struct hnae_handle *handle)
hns_ae_ring_enable_all(handle, 0);
+ /* clean rx fbd. */
+ hns_rcb_wait_fbd_clean(handle->qs, handle->q_num, RCB_INT_FLAG_RX);
+
(void)hns_mac_vm_config_bc_en(mac_cb, 0, false);
}