]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: hns3: initialize reset_timer before hclgevf_misc_irq_init()
authorJian Shen <shenjian15@huawei.com>
Mon, 6 Jan 2025 14:36:40 +0000 (22:36 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 8 Jan 2025 18:33:14 +0000 (10:33 -0800)
Currently the misc irq is initialized before reset_timer setup. But
it will access the reset_timer in the irq handler. So initialize
the reset_timer earlier.

Fixes: ff200099d271 ("net: hns3: remove unnecessary work in hclgevf_main")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20250106143642.539698-6-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index fd0abe37fdd7a6382833fbd1c71657baf299f917..163c6e59ea4c15e372cbcfbfa9b4571df1eaa1aa 100644 (file)
@@ -2313,6 +2313,8 @@ static void hclgevf_state_init(struct hclgevf_dev *hdev)
        clear_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state);
 
        INIT_DELAYED_WORK(&hdev->service_task, hclgevf_service_task);
+       /* timer needs to be initialized before misc irq */
+       timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
 
        mutex_init(&hdev->mbx_resp.mbx_mutex);
        sema_init(&hdev->reset_sem, 1);
@@ -3012,7 +3014,6 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev)
                 HCLGEVF_DRIVER_NAME);
 
        hclgevf_task_schedule(hdev, round_jiffies_relative(HZ));
-       timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
 
        return 0;