]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ibmvnic: Terminate waiting device threads after loss of service
authorThomas Falcon <tlfalcon@linux.ibm.com>
Mon, 25 Nov 2019 23:12:54 +0000 (17:12 -0600)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Nov 2019 21:19:31 +0000 (13:19 -0800)
If we receive a notification that the device has been deactivated
or removed, force a completion of all waiting threads.

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

index e1ab2feeae53d23b4da47f9ad2ed4b3e09c7f90b..dc1b881163305c7c96a14824dae95c80afc3109e 100644 (file)
@@ -4505,6 +4505,15 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
        case IBMVNIC_CRQ_XPORT_EVENT:
                netif_carrier_off(netdev);
                adapter->crq.active = false;
+               /* terminate any thread waiting for a response
+                * from the device
+                */
+               if (!completion_done(&adapter->fw_done)) {
+                       adapter->fw_done_rc = -EIO;
+                       complete(&adapter->fw_done);
+               }
+               if (!completion_done(&adapter->stats_done))
+                       complete(&adapter->stats_done);
                if (test_bit(0, &adapter->resetting))
                        adapter->force_reset_recovery = true;
                if (gen_crq->cmd == IBMVNIC_PARTITION_MIGRATED) {