@@ -364,21 +364,17 @@ static void ice_do_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
364
364
dev_dbg (dev , "reset_type 0x%x requested\n" , reset_type );
365
365
WARN_ON (in_interrupt ());
366
366
367
- /* PFR is a bit of a special case because it doesn't result in an OICR
368
- * interrupt. Set pending bit here which otherwise gets set in the
369
- * OICR handler.
370
- */
371
- if (reset_type == ICE_RESET_PFR )
372
- set_bit (__ICE_RESET_RECOVERY_PENDING , pf -> state );
373
-
374
367
ice_prepare_for_reset (pf );
375
368
376
369
/* trigger the reset */
377
370
if (ice_reset (hw , reset_type )) {
378
371
dev_err (dev , "reset %d failed\n" , reset_type );
379
372
set_bit (__ICE_RESET_FAILED , pf -> state );
380
- clear_bit (__ICE_RESET_RECOVERY_PENDING , pf -> state );
373
+ clear_bit (__ICE_RESET_OICR_RECV , pf -> state );
381
374
clear_bit (__ICE_PREPARED_FOR_RESET , pf -> state );
375
+ clear_bit (__ICE_PFR_REQ , pf -> state );
376
+ clear_bit (__ICE_CORER_REQ , pf -> state );
377
+ clear_bit (__ICE_GLOBR_REQ , pf -> state );
382
378
return ;
383
379
}
384
380
@@ -389,8 +385,8 @@ static void ice_do_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
389
385
if (reset_type == ICE_RESET_PFR ) {
390
386
pf -> pfr_count ++ ;
391
387
ice_rebuild (pf );
392
- clear_bit (__ICE_RESET_RECOVERY_PENDING , pf -> state );
393
388
clear_bit (__ICE_PREPARED_FOR_RESET , pf -> state );
389
+ clear_bit (__ICE_PFR_REQ , pf -> state );
394
390
}
395
391
}
396
392
@@ -405,14 +401,14 @@ static void ice_reset_subtask(struct ice_pf *pf)
405
401
/* When a CORER/GLOBR/EMPR is about to happen, the hardware triggers an
406
402
* OICR interrupt. The OICR handler (ice_misc_intr) determines what type
407
403
* of reset is pending and sets bits in pf->state indicating the reset
408
- * type and __ICE_RESET_RECOVERY_PENDING . So, if the latter bit is set
404
+ * type and __ICE_RESET_OICR_RECV . So, if the latter bit is set
409
405
* prepare for pending reset if not already (for PF software-initiated
410
406
* global resets the software should already be prepared for it as
411
407
* indicated by __ICE_PREPARED_FOR_RESET; for global resets initiated
412
408
* by firmware or software on other PFs, that bit is not set so prepare
413
409
* for the reset now), poll for reset done, rebuild and return.
414
410
*/
415
- if (ice_is_reset_recovery_pending ( pf -> state )) {
411
+ if (test_bit ( __ICE_RESET_OICR_RECV , pf -> state )) {
416
412
clear_bit (__ICE_GLOBR_RECV , pf -> state );
417
413
clear_bit (__ICE_CORER_RECV , pf -> state );
418
414
if (!test_bit (__ICE_PREPARED_FOR_RESET , pf -> state ))
@@ -428,19 +424,22 @@ static void ice_reset_subtask(struct ice_pf *pf)
428
424
/* clear bit to resume normal operations, but
429
425
* ICE_NEEDS_RESTART bit is set incase rebuild failed
430
426
*/
431
- clear_bit (__ICE_RESET_RECOVERY_PENDING , pf -> state );
427
+ clear_bit (__ICE_RESET_OICR_RECV , pf -> state );
432
428
clear_bit (__ICE_PREPARED_FOR_RESET , pf -> state );
429
+ clear_bit (__ICE_PFR_REQ , pf -> state );
430
+ clear_bit (__ICE_CORER_REQ , pf -> state );
431
+ clear_bit (__ICE_GLOBR_REQ , pf -> state );
433
432
}
434
433
435
434
return ;
436
435
}
437
436
438
437
/* No pending resets to finish processing. Check for new resets */
439
- if (test_and_clear_bit (__ICE_PFR_REQ , pf -> state ))
438
+ if (test_bit (__ICE_PFR_REQ , pf -> state ))
440
439
reset_type = ICE_RESET_PFR ;
441
- if (test_and_clear_bit (__ICE_CORER_REQ , pf -> state ))
440
+ if (test_bit (__ICE_CORER_REQ , pf -> state ))
442
441
reset_type = ICE_RESET_CORER ;
443
- if (test_and_clear_bit (__ICE_GLOBR_REQ , pf -> state ))
442
+ if (test_bit (__ICE_GLOBR_REQ , pf -> state ))
444
443
reset_type = ICE_RESET_GLOBR ;
445
444
/* If no valid reset type requested just return */
446
445
if (reset_type == ICE_RESET_INVAL )
@@ -1029,7 +1028,7 @@ static void ice_service_task(struct work_struct *work)
1029
1028
ice_reset_subtask (pf );
1030
1029
1031
1030
/* bail if a reset/recovery cycle is pending or rebuild failed */
1032
- if (ice_is_reset_recovery_pending (pf -> state ) ||
1031
+ if (ice_is_reset_in_progress (pf -> state ) ||
1033
1032
test_bit (__ICE_SUSPENDED , pf -> state ) ||
1034
1033
test_bit (__ICE_NEEDS_RESTART , pf -> state )) {
1035
1034
ice_service_task_complete (pf );
@@ -1250,8 +1249,7 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
1250
1249
* We also make note of which reset happened so that peer
1251
1250
* devices/drivers can be informed.
1252
1251
*/
1253
- if (!test_and_set_bit (__ICE_RESET_RECOVERY_PENDING ,
1254
- pf -> state )) {
1252
+ if (!test_and_set_bit (__ICE_RESET_OICR_RECV , pf -> state )) {
1255
1253
if (reset == ICE_RESET_CORER )
1256
1254
set_bit (__ICE_CORER_RECV , pf -> state );
1257
1255
else if (reset == ICE_RESET_GLOBR )
@@ -1265,7 +1263,7 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
1265
1263
* is received and set back to false after the driver
1266
1264
* has determined that the hardware is out of reset.
1267
1265
*
1268
- * __ICE_RESET_RECOVERY_PENDING in pf->state indicates
1266
+ * __ICE_RESET_OICR_RECV in pf->state indicates
1269
1267
* that a post reset rebuild is required before the
1270
1268
* driver is operational again. This is set above.
1271
1269
*
@@ -1355,7 +1353,7 @@ static int ice_req_irq_msix_misc(struct ice_pf *pf)
1355
1353
* lost during reset. Note that this function is called only during
1356
1354
* rebuild path and not while reset is in progress.
1357
1355
*/
1358
- if (ice_is_reset_recovery_pending (pf -> state ))
1356
+ if (ice_is_reset_in_progress (pf -> state ))
1359
1357
goto skip_req_irq ;
1360
1358
1361
1359
/* reserve one vector in irq_tracker for misc interrupts */
@@ -1637,7 +1635,7 @@ static int ice_setup_pf_sw(struct ice_pf *pf)
1637
1635
struct ice_vsi * vsi ;
1638
1636
int status = 0 ;
1639
1637
1640
- if (ice_is_reset_recovery_pending (pf -> state ))
1638
+ if (ice_is_reset_in_progress (pf -> state ))
1641
1639
return - EBUSY ;
1642
1640
1643
1641
vsi = ice_pf_vsi_setup (pf , pf -> hw .port_info );
@@ -2203,7 +2201,7 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
2203
2201
}
2204
2202
2205
2203
if (test_bit (__ICE_DOWN , pf -> state ) ||
2206
- ice_is_reset_recovery_pending (pf -> state )) {
2204
+ ice_is_reset_in_progress (pf -> state )) {
2207
2205
netdev_err (netdev , "can't set mac %pM. device not ready\n" ,
2208
2206
mac );
2209
2207
return - EBUSY ;
@@ -3256,7 +3254,7 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu)
3256
3254
}
3257
3255
/* if a reset is in progress, wait for some time for it to complete */
3258
3256
do {
3259
- if (ice_is_reset_recovery_pending (pf -> state )) {
3257
+ if (ice_is_reset_in_progress (pf -> state )) {
3260
3258
count ++ ;
3261
3259
usleep_range (1000 , 2000 );
3262
3260
} else {
0 commit comments