ibmvnic: Return error code if init interrupted by transport event
authorThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Wed, 23 May 2018 18:37:58 +0000 (13:37 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 May 2018 02:19:26 +0000 (22:19 -0400)
If device init is interrupted by a failover, set the init return
code so that it can be checked and handled appropriately by the
init routine.

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 70835198a2f95edc2c60e4e11e1583dd13506baa..f1f744ebb14ebd79dd2c389fc7ab68ac993463df 100644 (file)
@@ -4249,7 +4249,10 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
                        dev_info(dev, "Partner initialized\n");
                        adapter->from_passive_init = true;
                        adapter->failover_pending = false;
-                       complete(&adapter->init_done);
+                       if (!completion_done(&adapter->init_done)) {
+                               complete(&adapter->init_done);
+                               adapter->init_done_rc = -EIO;
+                       }
                        ibmvnic_reset(adapter, VNIC_RESET_FAILOVER);
                        break;
                case IBMVNIC_CRQ_INIT_COMPLETE: