net: hns3: skip periodic service task if reset failed
authorGuangbin Huang <huangguangbin2@huawei.com>
Tue, 8 Sep 2020 02:59:49 +0000 (10:59 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Sep 2020 02:51:40 +0000 (19:51 -0700)
When reset fails, if there are some pending jobs for the periodic
service task, it does not do anything except print error each
time the task is scheduled. So skip the periodic service task if
reset failed.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index d553ed7ee64c0aef5030f7ed550a23e41ac49a59..40d68a4ff83d57446c3828cd55e8d8d481973bf8 100644 (file)
@@ -3944,6 +3944,9 @@ static void hclge_periodic_service_task(struct hclge_dev *hdev)
 {
        unsigned long delta = round_jiffies_relative(HZ);
 
+       if (test_bit(HCLGE_STATE_RST_FAIL, &hdev->state))
+               return;
+
        /* Always handle the link updating to make sure link state is
         * updated when it is triggered by mbx.
         */
index 20dd04cc6d22b0983b29f9da896211e5df81ea1c..20dd50dd765ab36f87b5d6c2d6d40e76ef83db11 100644 (file)
@@ -2186,6 +2186,9 @@ static void hclgevf_periodic_service_task(struct hclgevf_dev *hdev)
        unsigned long delta = round_jiffies_relative(HZ);
        struct hnae3_handle *handle = &hdev->nic;
 
+       if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state))
+               return;
+
        if (time_is_after_jiffies(hdev->last_serv_processed + HZ)) {
                delta = jiffies - hdev->last_serv_processed;