ibmvnic: complete init_done on transport events
authorSukadev Bhattiprolu <sukadev@linux.ibm.com>
Fri, 25 Feb 2022 06:23:54 +0000 (22:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Feb 2022 10:57:47 +0000 (10:57 +0000)
If we get a transport event, set the error and mark the init as
complete so the attempt to send crq-init or login fail sooner
rather than wait for the timeout.

Fixes: bbd669a868bb ("ibmvnic: Fix completion structure initialization")
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c

index 42c3ac9..5913d37 100644 (file)
@@ -5356,6 +5356,13 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
                        adapter->fw_done_rc = -EIO;
                        complete(&adapter->fw_done);
                }
+
+               /* if we got here during crq-init, retry crq-init */
+               if (!completion_done(&adapter->init_done)) {
+                       adapter->init_done_rc = -EAGAIN;
+                       complete(&adapter->init_done);
+               }
+
                if (!completion_done(&adapter->stats_done))
                        complete(&adapter->stats_done);
                if (test_bit(0, &adapter->resetting))