Revert "ibmvnic: remove never executed if statement"
authorLijun Pan <ljp@linux.ibm.com>
Fri, 18 Sep 2020 02:12:46 +0000 (21:12 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Sep 2020 21:08:19 +0000 (14:08 -0700)
This reverts commit 550f4d46aff6fe57c9b1c6719c3c9de2237d7ac2.

adapter->from_passive_init may be changed in ibmvnic_handle_crq
while ibmvnic_reset_init is waiting for the completion of
adapter->init_done.

Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c

index e2a3c4bf00c98f9e5fddf359814840ed24b7442a..6d320be47e600ebe70dbb8839413bbcebe85e9fa 100644 (file)
@@ -5047,6 +5047,12 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter, bool reset)
                return adapter->init_done_rc;
        }
 
+       if (adapter->from_passive_init) {
+               adapter->state = VNIC_OPEN;
+               adapter->from_passive_init = false;
+               return -1;
+       }
+
        if (reset &&
            test_bit(0, &adapter->resetting) && !adapter->wait_for_reset &&
            adapter->reset_reason != VNIC_RESET_MOBILITY) {