@@ -11556,7 +11556,7 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
11556
11556
if (fw_reset ) {
11557
11557
set_bit (BNXT_STATE_FW_RESET_DET , & bp -> state );
11558
11558
if (!test_bit (BNXT_STATE_IN_FW_RESET , & bp -> state ))
11559
- bnxt_ulp_stop (bp );
11559
+ bnxt_ulp_irq_stop (bp );
11560
11560
bnxt_free_ctx_mem (bp );
11561
11561
bnxt_dcb_free (bp );
11562
11562
rc = bnxt_fw_init_one (bp );
@@ -12111,10 +12111,9 @@ static int bnxt_open(struct net_device *dev)
12111
12111
bnxt_hwrm_if_change (bp , false);
12112
12112
} else {
12113
12113
if (test_and_clear_bit (BNXT_STATE_FW_RESET_DET , & bp -> state )) {
12114
- if (!test_bit (BNXT_STATE_IN_FW_RESET , & bp -> state )) {
12115
- bnxt_ulp_start (bp , 0 );
12116
- bnxt_reenable_sriov (bp );
12117
- }
12114
+ if (!test_bit (BNXT_STATE_IN_FW_RESET , & bp -> state ))
12115
+ bnxt_queue_sp_work (bp ,
12116
+ BNXT_RESTART_ULP_SP_EVENT );
12118
12117
}
12119
12118
}
12120
12119
@@ -13270,7 +13269,6 @@ static void bnxt_fw_fatal_close(struct bnxt *bp)
13270
13269
13271
13270
static void bnxt_fw_reset_close (struct bnxt * bp )
13272
13271
{
13273
- bnxt_ulp_stop (bp );
13274
13272
/* When firmware is in fatal state, quiesce device and disable
13275
13273
* bus master to prevent any potential bad DMAs before freeing
13276
13274
* kernel memory.
@@ -13351,6 +13349,7 @@ void bnxt_fw_exception(struct bnxt *bp)
13351
13349
{
13352
13350
netdev_warn (bp -> dev , "Detected firmware fatal condition, initiating reset\n" );
13353
13351
set_bit (BNXT_STATE_FW_FATAL_COND , & bp -> state );
13352
+ bnxt_ulp_stop (bp );
13354
13353
bnxt_rtnl_lock_sp (bp );
13355
13354
bnxt_force_fw_reset (bp );
13356
13355
bnxt_rtnl_unlock_sp (bp );
@@ -13382,6 +13381,7 @@ static int bnxt_get_registered_vfs(struct bnxt *bp)
13382
13381
13383
13382
void bnxt_fw_reset (struct bnxt * bp )
13384
13383
{
13384
+ bnxt_ulp_stop (bp );
13385
13385
bnxt_rtnl_lock_sp (bp );
13386
13386
if (test_bit (BNXT_STATE_OPEN , & bp -> state ) &&
13387
13387
!test_bit (BNXT_STATE_IN_FW_RESET , & bp -> state )) {
@@ -13506,6 +13506,12 @@ static void bnxt_fw_echo_reply(struct bnxt *bp)
13506
13506
hwrm_req_send (bp , req );
13507
13507
}
13508
13508
13509
+ static void bnxt_ulp_restart (struct bnxt * bp )
13510
+ {
13511
+ bnxt_ulp_stop (bp );
13512
+ bnxt_ulp_start (bp , 0 );
13513
+ }
13514
+
13509
13515
static void bnxt_sp_task (struct work_struct * work )
13510
13516
{
13511
13517
struct bnxt * bp = container_of (work , struct bnxt , sp_task );
@@ -13517,6 +13523,11 @@ static void bnxt_sp_task(struct work_struct *work)
13517
13523
return ;
13518
13524
}
13519
13525
13526
+ if (test_and_clear_bit (BNXT_RESTART_ULP_SP_EVENT , & bp -> sp_event )) {
13527
+ bnxt_ulp_restart (bp );
13528
+ bnxt_reenable_sriov (bp );
13529
+ }
13530
+
13520
13531
if (test_and_clear_bit (BNXT_RX_MASK_SP_EVENT , & bp -> sp_event ))
13521
13532
bnxt_cfg_rx_mode (bp );
13522
13533
@@ -13973,10 +13984,8 @@ static bool bnxt_fw_reset_timeout(struct bnxt *bp)
13973
13984
static void bnxt_fw_reset_abort (struct bnxt * bp , int rc )
13974
13985
{
13975
13986
clear_bit (BNXT_STATE_IN_FW_RESET , & bp -> state );
13976
- if (bp -> fw_reset_state != BNXT_FW_RESET_STATE_POLL_VF ) {
13977
- bnxt_ulp_start (bp , rc );
13987
+ if (bp -> fw_reset_state != BNXT_FW_RESET_STATE_POLL_VF )
13978
13988
bnxt_dl_health_fw_status_update (bp , false);
13979
- }
13980
13989
bp -> fw_reset_state = 0 ;
13981
13990
dev_close (bp -> dev );
13982
13991
}
@@ -14007,7 +14016,7 @@ static void bnxt_fw_reset_task(struct work_struct *work)
14007
14016
bp -> fw_reset_state = 0 ;
14008
14017
netdev_err (bp -> dev , "Firmware reset aborted, bnxt_get_registered_vfs() returns %d\n" ,
14009
14018
n );
14010
- return ;
14019
+ goto ulp_start ;
14011
14020
}
14012
14021
bnxt_queue_fw_reset_work (bp , HZ / 10 );
14013
14022
return ;
@@ -14017,7 +14026,7 @@ static void bnxt_fw_reset_task(struct work_struct *work)
14017
14026
if (test_bit (BNXT_STATE_ABORT_ERR , & bp -> state )) {
14018
14027
bnxt_fw_reset_abort (bp , rc );
14019
14028
rtnl_unlock ();
14020
- return ;
14029
+ goto ulp_start ;
14021
14030
}
14022
14031
bnxt_fw_reset_close (bp );
14023
14032
if (bp -> fw_cap & BNXT_FW_CAP_ERR_RECOVER_RELOAD ) {
@@ -14110,7 +14119,7 @@ static void bnxt_fw_reset_task(struct work_struct *work)
14110
14119
netdev_err (bp -> dev , "bnxt_open() failed during FW reset\n" );
14111
14120
bnxt_fw_reset_abort (bp , rc );
14112
14121
rtnl_unlock ();
14113
- return ;
14122
+ goto ulp_start ;
14114
14123
}
14115
14124
14116
14125
if ((bp -> fw_cap & BNXT_FW_CAP_ERROR_RECOVERY ) &&
@@ -14122,17 +14131,19 @@ static void bnxt_fw_reset_task(struct work_struct *work)
14122
14131
/* Make sure fw_reset_state is 0 before clearing the flag */
14123
14132
smp_mb__before_atomic ();
14124
14133
clear_bit (BNXT_STATE_IN_FW_RESET , & bp -> state );
14125
- bnxt_ulp_start (bp , 0 );
14126
- bnxt_reenable_sriov (bp );
14127
- bnxt_vf_reps_alloc (bp );
14128
- bnxt_vf_reps_open (bp );
14129
14134
bnxt_ptp_reapply_pps (bp );
14130
14135
clear_bit (BNXT_STATE_FW_ACTIVATE , & bp -> state );
14131
14136
if (test_and_clear_bit (BNXT_STATE_RECOVER , & bp -> state )) {
14132
14137
bnxt_dl_health_fw_recovery_done (bp );
14133
14138
bnxt_dl_health_fw_status_update (bp , true);
14134
14139
}
14135
14140
rtnl_unlock ();
14141
+ bnxt_ulp_start (bp , 0 );
14142
+ bnxt_reenable_sriov (bp );
14143
+ rtnl_lock ();
14144
+ bnxt_vf_reps_alloc (bp );
14145
+ bnxt_vf_reps_open (bp );
14146
+ rtnl_unlock ();
14136
14147
break ;
14137
14148
}
14138
14149
return ;
@@ -14148,6 +14159,8 @@ static void bnxt_fw_reset_task(struct work_struct *work)
14148
14159
rtnl_lock ();
14149
14160
bnxt_fw_reset_abort (bp , rc );
14150
14161
rtnl_unlock ();
14162
+ ulp_start :
14163
+ bnxt_ulp_start (bp , rc );
14151
14164
}
14152
14165
14153
14166
static int bnxt_init_board (struct pci_dev * pdev , struct net_device * dev )
@@ -15534,8 +15547,9 @@ static int bnxt_suspend(struct device *device)
15534
15547
struct bnxt * bp = netdev_priv (dev );
15535
15548
int rc = 0 ;
15536
15549
15537
- rtnl_lock ();
15538
15550
bnxt_ulp_stop (bp );
15551
+
15552
+ rtnl_lock ();
15539
15553
if (netif_running (dev )) {
15540
15554
netif_device_detach (dev );
15541
15555
rc = bnxt_close (dev );
@@ -15590,10 +15604,10 @@ static int bnxt_resume(struct device *device)
15590
15604
}
15591
15605
15592
15606
resume_exit :
15607
+ rtnl_unlock ();
15593
15608
bnxt_ulp_start (bp , rc );
15594
15609
if (!rc )
15595
15610
bnxt_reenable_sriov (bp );
15596
- rtnl_unlock ();
15597
15611
return rc ;
15598
15612
}
15599
15613
@@ -15623,11 +15637,11 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev,
15623
15637
15624
15638
netdev_info (netdev , "PCI I/O error detected\n" );
15625
15639
15640
+ bnxt_ulp_stop (bp );
15641
+
15626
15642
rtnl_lock ();
15627
15643
netif_device_detach (netdev );
15628
15644
15629
- bnxt_ulp_stop (bp );
15630
-
15631
15645
if (test_and_set_bit (BNXT_STATE_IN_FW_RESET , & bp -> state )) {
15632
15646
netdev_err (bp -> dev , "Firmware reset already in progress\n" );
15633
15647
abort = true;
@@ -15763,13 +15777,13 @@ static void bnxt_io_resume(struct pci_dev *pdev)
15763
15777
if (!err && netif_running (netdev ))
15764
15778
err = bnxt_open (netdev );
15765
15779
15766
- bnxt_ulp_start (bp , err );
15767
- if (!err ) {
15768
- bnxt_reenable_sriov (bp );
15780
+ if (!err )
15769
15781
netif_device_attach (netdev );
15770
- }
15771
15782
15772
15783
rtnl_unlock ();
15784
+ bnxt_ulp_start (bp , err );
15785
+ if (!err )
15786
+ bnxt_reenable_sriov (bp );
15773
15787
}
15774
15788
15775
15789
static const struct pci_error_handlers bnxt_err_handler = {
0 commit comments