[PATCH net-next 08/12] net: hns3: handle pending reset while reset fail
From: Huazhong Tan
Date: Sat Apr 06 2019 - 03:45:36 EST
The ongoing lower-level reset will fail when there is a higher-level
reset occurs, so the error handler should deal with this situation.
Fixes: 6a5f6fa382f3 ("net: hns3: add error handler for hclgevf_reset()")
Signed-off-by: Huazhong Tan <tanhuazhong@xxxxxxxxxx>
Signed-off-by: Peng Li <lipeng321@xxxxxxxxxx>
---
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 509ff93..0d9dd5e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -1474,6 +1474,8 @@ static int hclgevf_reset(struct hclgevf_dev *hdev)
*/
hclgevf_cmd_init(hdev);
dev_err(&hdev->pdev->dev, "failed to reset VF\n");
+ if (hclgevf_is_reset_pending(hdev))
+ hclgevf_reset_task_schedule(hdev);
return ret;
}
--
2.7.4