From: Thomas Falcon <tlfalcon@linux.ibm.com> To: netdev@vger.kernel.org Cc: linuxppc-dev@ozlabs.org, dnbanerg@us.ibm.com, brking@linux.vnet.ibm.com, julietk@linux.vnet.ibm.com, Thomas Falcon <tlfalcon@linux.ibm.com> Subject: [PATCH net 2/4] ibmvnic: Terminate waiting device threads after loss of service Date: Fri, 22 Nov 2019 13:41:44 -0600 [thread overview] Message-ID: <1574451706-19058-3-git-send-email-tlfalcon@linux.ibm.com> (raw) In-Reply-To: <1574451706-19058-1-git-send-email-tlfalcon@linux.ibm.com> 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> --- drivers/net/ethernet/ibm/ibmvnic.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 48225297a5e2..78a3ef70f1ef 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4500,6 +4500,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) { -- 2.12.3
WARNING: multiple messages have this Message-ID (diff)
From: Thomas Falcon <tlfalcon@linux.ibm.com> To: netdev@vger.kernel.org Cc: brking@linux.vnet.ibm.com, linuxppc-dev@ozlabs.org, julietk@linux.vnet.ibm.com, Thomas Falcon <tlfalcon@linux.ibm.com>, dnbanerg@us.ibm.com Subject: [PATCH net 2/4] ibmvnic: Terminate waiting device threads after loss of service Date: Fri, 22 Nov 2019 13:41:44 -0600 [thread overview] Message-ID: <1574451706-19058-3-git-send-email-tlfalcon@linux.ibm.com> (raw) In-Reply-To: <1574451706-19058-1-git-send-email-tlfalcon@linux.ibm.com> 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> --- drivers/net/ethernet/ibm/ibmvnic.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 48225297a5e2..78a3ef70f1ef 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4500,6 +4500,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) { -- 2.12.3
next prev parent reply other threads:[~2019-11-22 19:42 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-11-22 19:41 [PATCH net 0/4] ibmvnic: Harden device commands and queries Thomas Falcon 2019-11-22 19:41 ` Thomas Falcon 2019-11-22 19:41 ` [PATCH net 1/4] ibmvnic: Fix completion structure initialization Thomas Falcon 2019-11-22 19:41 ` Thomas Falcon 2019-11-22 19:41 ` Thomas Falcon [this message] 2019-11-22 19:41 ` [PATCH net 2/4] ibmvnic: Terminate waiting device threads after loss of service Thomas Falcon 2019-11-22 19:41 ` [PATCH net 3/4] ibmvnic: Bound waits for device queries Thomas Falcon 2019-11-22 19:41 ` Thomas Falcon 2019-11-24 1:46 ` Jakub Kicinski 2019-11-24 1:46 ` Jakub Kicinski 2019-11-22 19:41 ` [PATCH net 4/4] ibmvnic: Serialize " Thomas Falcon 2019-11-22 19:41 ` Thomas Falcon 2019-11-24 1:47 ` Jakub Kicinski 2019-11-24 1:47 ` Jakub Kicinski 2019-11-24 1:49 ` [PATCH net 0/4] ibmvnic: Harden device commands and queries Jakub Kicinski 2019-11-24 1:49 ` Jakub Kicinski 2019-11-25 18:40 ` Thomas Falcon 2019-11-25 18:40 ` Thomas Falcon 2019-11-25 19:23 ` Jakub Kicinski 2019-11-25 19:23 ` Jakub Kicinski 2019-11-25 23:12 ` [PATCH net v2 " Thomas Falcon 2019-11-25 23:12 ` Thomas Falcon 2019-11-25 23:12 ` [PATCH net v2 1/4] ibmvnic: Fix completion structure initialization Thomas Falcon 2019-11-25 23:12 ` Thomas Falcon 2019-11-25 23:12 ` [PATCH net v2 2/4] ibmvnic: Terminate waiting device threads after loss of service Thomas Falcon 2019-11-25 23:12 ` Thomas Falcon 2019-11-25 23:12 ` [PATCH net v2 3/4] ibmvnic: Bound waits for device queries Thomas Falcon 2019-11-25 23:12 ` Thomas Falcon 2019-11-25 23:12 ` [PATCH net v2 4/4] ibmvnic: Serialize " Thomas Falcon 2019-11-25 23:12 ` Thomas Falcon 2019-11-26 21:19 ` [PATCH net v2 0/4] ibmvnic: Harden device commands and queries David Miller 2019-11-26 21:19 ` David Miller
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1574451706-19058-3-git-send-email-tlfalcon@linux.ibm.com \ --to=tlfalcon@linux.ibm.com \ --cc=brking@linux.vnet.ibm.com \ --cc=dnbanerg@us.ibm.com \ --cc=julietk@linux.vnet.ibm.com \ --cc=linuxppc-dev@ozlabs.org \ --cc=netdev@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.