.. | .. |
---|
542 | 542 | /* Start the hardware monitor if there is one */ |
---|
543 | 543 | efx_start_monitor(efx); |
---|
544 | 544 | |
---|
| 545 | + efx_selftest_async_start(efx); |
---|
| 546 | + |
---|
545 | 547 | /* Link state detection is normally event-driven; we have |
---|
546 | 548 | * to poll now because we could have missed a change |
---|
547 | 549 | */ |
---|
.. | .. |
---|
897 | 899 | * have changed by now. Now that we have the RTNL lock, |
---|
898 | 900 | * it cannot change again. |
---|
899 | 901 | */ |
---|
900 | | - if (efx->state == STATE_READY) |
---|
| 902 | + if (efx_net_active(efx->state)) |
---|
901 | 903 | (void)efx_reset(efx, method); |
---|
902 | 904 | |
---|
903 | 905 | rtnl_unlock(); |
---|
.. | .. |
---|
907 | 909 | { |
---|
908 | 910 | enum reset_type method; |
---|
909 | 911 | |
---|
910 | | - if (efx->state == STATE_RECOVERY) { |
---|
| 912 | + if (efx_recovering(efx->state)) { |
---|
911 | 913 | netif_dbg(efx, drv, efx->net_dev, |
---|
912 | 914 | "recovering: skip scheduling %s reset\n", |
---|
913 | 915 | RESET_TYPE(type)); |
---|
.. | .. |
---|
942 | 944 | /* If we're not READY then just leave the flags set as the cue |
---|
943 | 945 | * to abort probing or reschedule the reset later. |
---|
944 | 946 | */ |
---|
945 | | - if (READ_ONCE(efx->state) != STATE_READY) |
---|
| 947 | + if (!efx_net_active(READ_ONCE(efx->state))) |
---|
946 | 948 | return; |
---|
947 | 949 | |
---|
948 | 950 | /* efx_process_channel() will no longer read events once a |
---|
.. | .. |
---|
1214 | 1216 | rtnl_lock(); |
---|
1215 | 1217 | |
---|
1216 | 1218 | if (efx->state != STATE_DISABLED) { |
---|
1217 | | - efx->state = STATE_RECOVERY; |
---|
| 1219 | + efx->state = efx_recover(efx->state); |
---|
1218 | 1220 | efx->reset_pending = 0; |
---|
1219 | 1221 | |
---|
1220 | 1222 | efx_device_detach_sync(efx); |
---|
.. | .. |
---|
1268 | 1270 | netif_err(efx, hw, efx->net_dev, |
---|
1269 | 1271 | "efx_reset failed after PCI error (%d)\n", rc); |
---|
1270 | 1272 | } else { |
---|
1271 | | - efx->state = STATE_READY; |
---|
| 1273 | + efx->state = efx_recovered(efx->state); |
---|
1272 | 1274 | netif_dbg(efx, hw, efx->net_dev, |
---|
1273 | 1275 | "Done resetting and resuming IO after PCI error.\n"); |
---|
1274 | 1276 | } |
---|