@@ -2437,6 +2437,12 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
struct net_device *netdev = adapter->netdev;
int ret;
+ if (adapter->state == VNIC_PROBING) {
+ netdev_warn(netdev, "Adapter reset during probe\n");
+ ret = adapter->init_done_rc = EAGAIN;
+ goto err;
+ }
+
/*
* If failover is pending don't schedule any other reset.
* Instead let the failover complete. If there is already a
@@ -2451,12 +2457,6 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
goto err;
}
- if (adapter->state == VNIC_PROBING) {
- netdev_warn(netdev, "Adapter reset during probe\n");
- ret = adapter->init_done_rc = EAGAIN;
- goto err;
- }
-
/* If we just received a transport event, clear
* any pending resets and add just this reset.
*/
We check separately for REMOVING and PROBING in ibmvnic_reset(). Switch the order of checks to facilitate better locking when checking for REMOVING/REMOVED state. Fixes: 6a2fb0e99f9c ("ibmvnic: driver initialization for kdump/kexec") Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com> --- drivers/net/ethernet/ibm/ibmvnic.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)