From mboxrd@z Thu Jan 1 00:00:00 1970 From: Huazhong Tan Subject: [Patch net 11/11] net: hns3: bugfix for rtnl_lock's range in the hclgevf_reset() Date: Sat, 27 Oct 2018 10:41:58 +0800 Message-ID: <1540608118-27449-12-git-send-email-tanhuazhong@huawei.com> References: <1540608118-27449-1-git-send-email-tanhuazhong@huawei.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , , , , Huazhong Tan To: Return-path: Received: from szxga04-in.huawei.com ([45.249.212.190]:14121 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727829AbeJ0LVj (ORCPT ); Sat, 27 Oct 2018 07:21:39 -0400 In-Reply-To: <1540608118-27449-1-git-send-email-tanhuazhong@huawei.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 release the lock for the duration of hclgevf_reset_wait(). Fixes: 6988eb2a9b77 ("net: hns3: Add support to reset the enet/ring mgmt layer") Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 552b708..fa6251e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -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 */ @@ -1187,6 +1189,8 @@ static int hclgevf_reset(struct hclgevf_dev *hdev) return ret; } + rtnl_lock(); + /* now, re-initialize the nic client and ae device*/ ret = hclgevf_reset_stack(hdev); if (ret) -- 2.7.4