aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuazhong Tan <tanhuazhong@huawei.com>2018-10-30 09:50:53 -0400
committerDavid S. Miller <davem@davemloft.net>2018-10-31 15:42:38 -0400
commit29118ab962d5476fdc65fae312ac38db68092d78 (patch)
tree21cf022779b02c35f829e374ccba404b07314850
parenta963052e539887df481d4d3a6ad4c92ca6461852 (diff)
net: hns3: bugfix for rtnl_lock's range in the hclgevf_reset()
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: 6988eb2a9b77 ("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>
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index b224f6a34030..085edb945389 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)
1170 /* bring down the nic to stop any ongoing TX/RX */ 1170 /* bring down the nic to stop any ongoing TX/RX */
1171 hclgevf_notify_client(hdev, HNAE3_DOWN_CLIENT); 1171 hclgevf_notify_client(hdev, HNAE3_DOWN_CLIENT);
1172 1172
1173 rtnl_unlock();
1174
1173 /* check if VF could successfully fetch the hardware reset completion 1175 /* check if VF could successfully fetch the hardware reset completion
1174 * status from the hardware 1176 * status from the hardware
1175 */ 1177 */
@@ -1181,12 +1183,15 @@ static int hclgevf_reset(struct hclgevf_dev *hdev)
1181 ret); 1183 ret);
1182 1184
1183 dev_warn(&hdev->pdev->dev, "VF reset failed, disabling VF!\n"); 1185 dev_warn(&hdev->pdev->dev, "VF reset failed, disabling VF!\n");
1186 rtnl_lock();
1184 hclgevf_notify_client(hdev, HNAE3_UNINIT_CLIENT); 1187 hclgevf_notify_client(hdev, HNAE3_UNINIT_CLIENT);
1185 1188
1186 rtnl_unlock(); 1189 rtnl_unlock();
1187 return ret; 1190 return ret;
1188 } 1191 }
1189 1192
1193 rtnl_lock();
1194
1190 /* now, re-initialize the nic client and ae device*/ 1195 /* now, re-initialize the nic client and ae device*/
1191 ret = hclgevf_reset_stack(hdev); 1196 ret = hclgevf_reset_stack(hdev);
1192 if (ret) 1197 if (ret)