Skip to content

Commit cbfb588

Browse files
IronShenjfvogel
authored andcommitted
net: hns3: initialize reset_timer before hclgevf_misc_irq_init()
[ Upstream commit 247fd1e ] 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: ff20009 ("net: hns3: remove unnecessary work in hclgevf_main") Signed-off-by: Jian Shen <[email protected]> Signed-off-by: Jijie Shao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 13c11ca317f5629bd77eda369dcf54c4ea1e181d) Signed-off-by: Jack Vogel <[email protected]>
1 parent a2ad125 commit cbfb588

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2315,6 +2315,8 @@ static void hclgevf_state_init(struct hclgevf_dev *hdev)
23152315
clear_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state);
23162316

23172317
INIT_DELAYED_WORK(&hdev->service_task, hclgevf_service_task);
2318+
/* timer needs to be initialized before misc irq */
2319+
timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
23182320

23192321
mutex_init(&hdev->mbx_resp.mbx_mutex);
23202322
sema_init(&hdev->reset_sem, 1);
@@ -3014,7 +3016,6 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev)
30143016
HCLGEVF_DRIVER_NAME);
30153017

30163018
hclgevf_task_schedule(hdev, round_jiffies_relative(HZ));
3017-
timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
30183019

30193020
return 0;
30203021

0 commit comments

Comments
 (0)