@@ -2465,15 +2465,14 @@ static void hclge_clear_reset_cause(struct hclge_dev *hdev)
24652465static void hclge_reset (struct hclge_dev * hdev )
24662466{
24672467 struct hnae3_ae_dev * ae_dev = pci_get_drvdata (hdev -> pdev );
2468- struct hnae3_handle * handle ;
24692468
24702469 /* Initialize ae_dev reset status as well, in case enet layer wants to
24712470 * know if device is undergoing reset
24722471 */
24732472 ae_dev -> reset_type = hdev -> reset_type ;
24742473 hdev -> reset_count ++ ;
2474+ hdev -> last_reset_time = jiffies ;
24752475 /* perform reset of the stack & ae device for a client */
2476- handle = & hdev -> vport [0 ].nic ;
24772476 rtnl_lock ();
24782477 hclge_notify_client (hdev , HNAE3_DOWN_CLIENT );
24792478 rtnl_unlock ();
@@ -2493,7 +2492,6 @@ static void hclge_reset(struct hclge_dev *hdev)
24932492 }
24942493
24952494 hclge_notify_client (hdev , HNAE3_UP_CLIENT );
2496- handle -> last_reset_time = jiffies ;
24972495 rtnl_unlock ();
24982496 ae_dev -> reset_type = HNAE3_NONE_RESET ;
24992497}
@@ -2521,24 +2519,24 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle)
25212519 if (!handle )
25222520 handle = & hdev -> vport [0 ].nic ;
25232521
2524- if (time_before (jiffies , (handle -> last_reset_time + 3 * HZ )))
2522+ if (time_before (jiffies , (hdev -> last_reset_time + 3 * HZ )))
25252523 return ;
25262524 else if (hdev -> default_reset_request )
2527- handle -> reset_level =
2525+ hdev -> reset_level =
25282526 hclge_get_reset_level (hdev ,
25292527 & hdev -> default_reset_request );
2530- else if (time_after (jiffies , (handle -> last_reset_time + 4 * 5 * HZ )))
2531- handle -> reset_level = HNAE3_FUNC_RESET ;
2528+ else if (time_after (jiffies , (hdev -> last_reset_time + 4 * 5 * HZ )))
2529+ hdev -> reset_level = HNAE3_FUNC_RESET ;
25322530
25332531 dev_info (& hdev -> pdev -> dev , "received reset event , reset type is %d" ,
2534- handle -> reset_level );
2532+ hdev -> reset_level );
25352533
25362534 /* request reset & schedule reset task */
2537- set_bit (handle -> reset_level , & hdev -> reset_request );
2535+ set_bit (hdev -> reset_level , & hdev -> reset_request );
25382536 hclge_reset_task_schedule (hdev );
25392537
2540- if (handle -> reset_level < HNAE3_GLOBAL_RESET )
2541- handle -> reset_level ++ ;
2538+ if (hdev -> reset_level < HNAE3_GLOBAL_RESET )
2539+ hdev -> reset_level ++ ;
25422540}
25432541
25442542static void hclge_set_def_reset_request (struct hnae3_ae_dev * ae_dev ,
@@ -2560,6 +2558,7 @@ static void hclge_reset_subtask(struct hclge_dev *hdev)
25602558 * b. else, we can come back later to check this status so re-sched
25612559 * now.
25622560 */
2561+ hdev -> last_reset_time = jiffies ;
25632562 hdev -> reset_type = hclge_get_reset_level (hdev , & hdev -> reset_pending );
25642563 if (hdev -> reset_type != HNAE3_NONE_RESET )
25652564 hclge_reset (hdev );
@@ -6670,6 +6669,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
66706669 hdev -> pdev = pdev ;
66716670 hdev -> ae_dev = ae_dev ;
66726671 hdev -> reset_type = HNAE3_NONE_RESET ;
6672+ hdev -> reset_level = HNAE3_FUNC_RESET ;
66736673 ae_dev -> priv = hdev ;
66746674
66756675 ret = hclge_pci_init (hdev );
@@ -6814,6 +6814,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
68146814 hclge_enable_vector (& hdev -> misc_vector , true);
68156815
68166816 hclge_state_init (hdev );
6817+ hdev -> last_reset_time = jiffies ;
68176818
68186819 pr_info ("%s driver initialization finished.\n" , HCLGE_DRIVER_NAME );
68196820 return 0 ;
0 commit comments