From: Yonglong Liu Date: Sat, 15 Dec 2018 03:53:24 +0000 (+0800) Subject: net: hns: Clean rx fbd when ae stopped. X-Git-Tag: v4.20~27^2~36^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=31f6b61d810654fb3ef43f4d8afda0f44b142fad;p=thirdparty%2Fkernel%2Flinux.git net: hns: Clean rx fbd when ae stopped. 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 Signed-off-by: Peng Li Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c index b52029e26d153..ad1779fc410e6 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); }