ibmvnic: Set resetting state at earliest possible point
authorThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Wed, 23 May 2018 18:38:01 +0000 (13:38 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 May 2018 02:19:26 +0000 (22:19 -0400)
Set device resetting state at the earliest possible point: as soon as a
reset is successfully scheduled. The reset state is toggled off when
all resets have been processed to completion.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c

index f26e1f893441c27328b77c48c04580d77c1867dc..ee51deba7a12973ecd5cbcd3d6533b0624325467 100644 (file)
@@ -1919,7 +1919,6 @@ static void __ibmvnic_reset(struct work_struct *work)
        netdev = adapter->netdev;
 
        mutex_lock(&adapter->reset_lock);
-       adapter->resetting = true;
        reset_state = adapter->state;
 
        rwi = get_next_rwi(adapter);
@@ -1994,7 +1993,7 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
        rwi->reset_reason = reason;
        list_add_tail(&rwi->list, &adapter->rwi_list);
        mutex_unlock(&adapter->rwi_lock);
-
+       adapter->resetting = true;
        netdev_dbg(adapter->netdev, "Scheduling reset (reason %d)\n", reason);
        schedule_work(&adapter->ibmvnic_reset);