Skip to content

Commit be5e816

Browse files
Jie WangPaolo Abeni
authored andcommitted
net: hns3: fix a deadlock problem when config TC during resetting
When config TC during the reset process, may cause a deadlock, the flow is as below: pf reset start │ ▼ ...... setup tc │ │ ▼ ▼ DOWN: napi_disable() napi_disable()(skip) │ │ │ ▼ ▼ ...... ...... │ │ ▼ │ napi_enable() │ ▼ UINIT: netif_napi_del() │ ▼ ...... │ ▼ INIT: netif_napi_add() │ ▼ ...... global reset start │ │ ▼ ▼ UP: napi_enable()(skip) ...... │ │ ▼ ▼ ...... napi_disable() In reset process, the driver will DOWN the port and then UINIT, in this case, the setup tc process will UP the port before UINIT, so cause the problem. Adds a DOWN process in UINIT to fix it. Fixes: bb6b94a ("net: hns3: Add reset interface implementation in client") Signed-off-by: Jie Wang <[email protected]> Signed-off-by: Jijie Shao <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 30545e1 commit be5e816

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5724,6 +5724,9 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)
57245724
struct net_device *netdev = handle->kinfo.netdev;
57255725
struct hns3_nic_priv *priv = netdev_priv(netdev);
57265726

5727+
if (!test_bit(HNS3_NIC_STATE_DOWN, &priv->state))
5728+
hns3_nic_net_stop(netdev);
5729+
57275730
if (!test_and_clear_bit(HNS3_NIC_STATE_INITED, &priv->state)) {
57285731
netdev_warn(netdev, "already uninitialized\n");
57295732
return 0;

0 commit comments

Comments
 (0)