aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonglong Liu <[email protected]>2018-12-15 11:53:24 +0800
committerDavid S. Miller <[email protected]>2018-12-16 12:07:32 -0800
commit31f6b61d810654fb3ef43f4d8afda0f44b142fad (patch)
tree4f99af285fd4d6505b306db61f7f4f8bbd699905
parent5778b13b64eca5549d242686f2f91a2c80c8fa40 (diff)
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 <[email protected]> Signed-off-by: Peng Li <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-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);
}