]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: hns3: Fix for netdev not running problem after calling net_stop and net_open
authorFuyun Liang <liangfuyun1@huawei.com>
Sat, 19 May 2018 15:53:21 +0000 (16:53 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 18:41:11 +0000 (14:41 -0400)
BugLink: https://bugs.launchpad.net/bugs/1768670
The link status update function is called by timer every second. But
net_stop and net_open may be called with very short intervals. The link
status update function can not detect the link state has changed. It
causes the netdev not running problem.

This patch fixes it by updating the link state in ae_stop function.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f30dfddcca1b7773ef8ed8ddbf2d477bc5eb9f3e linux-next)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 46e030c41fe94baa3fa674748e2fa88c26f37381..2f0bbb6708b98e675aa928cd3ec7c134836d7f6d 100644 (file)
@@ -3793,6 +3793,9 @@ static void hclge_ae_stop(struct hnae3_handle *handle)
 
        /* reset tqp stats */
        hclge_reset_tqp_stats(handle);
+       del_timer_sync(&hdev->service_timer);
+       cancel_work_sync(&hdev->service_task);
+       hclge_update_link_status(hdev);
 }
 
 static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport,