Skip to content

Commit

Permalink
net: hns3: bugfix for rtnl_lock's range in the hclgevf_reset()
Browse files Browse the repository at this point in the history
Since hclgevf_reset_wait() is used to wait for the hardware to complete
the reset, it is not necessary to hold the rtnl_lock during
hclgevf_reset_wait(). So this patch releases the lock for the duration
of hclgevf_reset_wait().

Fixes: 6988eb2 ("net: hns3: Add support to reset the enet/ring mgmt layer")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Huazhong Tan authored and David S. Miller committed Oct 31, 2018
1 parent a963052 commit 29118ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,8 @@ static int hclgevf_reset(struct hclgevf_dev *hdev)
/* bring down the nic to stop any ongoing TX/RX */
hclgevf_notify_client(hdev, HNAE3_DOWN_CLIENT);

rtnl_unlock();

/* check if VF could successfully fetch the hardware reset completion
* status from the hardware
*/
Expand All @@ -1181,12 +1183,15 @@ static int hclgevf_reset(struct hclgevf_dev *hdev)
ret);

dev_warn(&hdev->pdev->dev, "VF reset failed, disabling VF!\n");
rtnl_lock();
hclgevf_notify_client(hdev, HNAE3_UNINIT_CLIENT);

rtnl_unlock();
return ret;
}

rtnl_lock();

/* now, re-initialize the nic client and ae device*/
ret = hclgevf_reset_stack(hdev);
if (ret)
Expand Down

0 comments on commit 29118ab

Please sign in to comment.