Commit 8e2fe3b6 authored by Jian Shen's avatar Jian Shen Committed by openeuler-sync-bot
Browse files

net: hns3: initialize reset_timer before hclgevf_misc_irq_init()

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAP2LZ



----------------------------------------------------------------------

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: ff200099 ("net: hns3: remove unnecessary work in hclgevf_main")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarXinghai Cen <cenxinghai@h-partners.com>
(cherry picked from commit 9e4dbb8a)
parent 8b7726e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2472,6 +2472,7 @@ 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_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);

	mutex_init(&hdev->mbx_resp.mbx_mutex);
	sema_init(&hdev->reset_sem, 1);
@@ -3315,7 +3316,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;