Return early from fm10k_down() when we are already down, since that
means another thread is either already finished or has started going
down, so shouldn't conflict with them.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
        int err;
 
        /* signal that we are down to the interrupt handler and service task */
-       set_bit(__FM10K_DOWN, &interface->state);
+       if (test_and_set_bit(__FM10K_DOWN, &interface->state))
+               return;
 
        /* call carrier off first to avoid false dev_watchdog timeouts */
        netif_carrier_off(netdev);