Commit 8e9eee78 authored by Huazhong Tan's avatar Huazhong Tan Committed by David S. Miller

net: hns3: remove upgrade reset level when reset fail

Currently, hclge_reset_err_handle() will assert a global reset
when the failing count is smaller than MAX_RESET_FAIL_CNT, which
will affect other running functions.

So this patch removes this upgrading, and uses re-scheduling reset
task to do it.
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Reviewed-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aa3253b8
...@@ -3305,7 +3305,7 @@ static int hclge_reset_prepare_wait(struct hclge_dev *hdev) ...@@ -3305,7 +3305,7 @@ static int hclge_reset_prepare_wait(struct hclge_dev *hdev)
return ret; return ret;
} }
static bool hclge_reset_err_handle(struct hclge_dev *hdev, bool is_timeout) static bool hclge_reset_err_handle(struct hclge_dev *hdev)
{ {
#define MAX_RESET_FAIL_CNT 5 #define MAX_RESET_FAIL_CNT 5
...@@ -3322,20 +3322,11 @@ static bool hclge_reset_err_handle(struct hclge_dev *hdev, bool is_timeout) ...@@ -3322,20 +3322,11 @@ static bool hclge_reset_err_handle(struct hclge_dev *hdev, bool is_timeout)
return false; return false;
} else if (hdev->reset_fail_cnt < MAX_RESET_FAIL_CNT) { } else if (hdev->reset_fail_cnt < MAX_RESET_FAIL_CNT) {
hdev->reset_fail_cnt++; hdev->reset_fail_cnt++;
if (is_timeout) { set_bit(hdev->reset_type, &hdev->reset_pending);
set_bit(hdev->reset_type, &hdev->reset_pending); dev_info(&hdev->pdev->dev,
dev_info(&hdev->pdev->dev, "re-schedule reset task(%d)\n",
"re-schedule to wait for hw reset done\n"); hdev->reset_fail_cnt);
return true; return true;
}
dev_info(&hdev->pdev->dev, "Upgrade reset level\n");
hclge_clear_reset_cause(hdev);
set_bit(HNAE3_GLOBAL_RESET, &hdev->default_reset_request);
mod_timer(&hdev->reset_timer,
jiffies + HCLGE_RESET_INTERVAL);
return false;
} }
hclge_clear_reset_cause(hdev); hclge_clear_reset_cause(hdev);
...@@ -3382,7 +3373,6 @@ static int hclge_reset_stack(struct hclge_dev *hdev) ...@@ -3382,7 +3373,6 @@ static int hclge_reset_stack(struct hclge_dev *hdev)
static void hclge_reset(struct hclge_dev *hdev) static void hclge_reset(struct hclge_dev *hdev)
{ {
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev); struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev);
bool is_timeout = false;
int ret; int ret;
/* Initialize ae_dev reset status as well, in case enet layer wants to /* Initialize ae_dev reset status as well, in case enet layer wants to
...@@ -3410,10 +3400,8 @@ static void hclge_reset(struct hclge_dev *hdev) ...@@ -3410,10 +3400,8 @@ static void hclge_reset(struct hclge_dev *hdev)
if (ret) if (ret)
goto err_reset; goto err_reset;
if (hclge_reset_wait(hdev)) { if (hclge_reset_wait(hdev))
is_timeout = true;
goto err_reset; goto err_reset;
}
hdev->rst_stats.hw_reset_done_cnt++; hdev->rst_stats.hw_reset_done_cnt++;
...@@ -3465,7 +3453,7 @@ static void hclge_reset(struct hclge_dev *hdev) ...@@ -3465,7 +3453,7 @@ static void hclge_reset(struct hclge_dev *hdev)
err_reset_lock: err_reset_lock:
rtnl_unlock(); rtnl_unlock();
err_reset: err_reset:
if (hclge_reset_err_handle(hdev, is_timeout)) if (hclge_reset_err_handle(hdev))
hclge_reset_task_schedule(hdev); hclge_reset_task_schedule(hdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment