diff options
author | Shradha Gupta <shradhagupta@linux.microsoft.com> | 2022-07-11 07:11:47 +0300 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2022-07-11 21:53:42 +0300 |
commit | 52be93558a9b32f5294750c1394d81e31fe11d6d (patch) | |
tree | 867b177769257c5f8d4dc3be4685e90694d22918 /drivers/hv/connection.c | |
parent | 32346491ddf24599decca06190ebca03ff9de7f8 (diff) | |
download | linux-52be93558a9b32f5294750c1394d81e31fe11d6d.tar.xz |
Drivers: hv: vm_bus: Handle vmbus rescind calls after vmbus is suspended
Add a flag to indicate that the vmbus is suspended so we should ignore
any offer message. Add a new work_queue for rescind msg, so we could drain
it along with other offer work_queues upon suspension.
It was observed that in some hibernation related scenario testing, after
vmbus_bus_suspend() we get rescind offer message for the vmbus. This would
lead to processing of a rescind message for a channel that has already been
suspended.
Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20220711041147.GA5569@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'drivers/hv/connection.c')
-rw-r--r-- | drivers/hv/connection.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index 6218bbf6863a..eca7afd366d6 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -171,6 +171,14 @@ int vmbus_connect(void) goto cleanup; } + vmbus_connection.rescind_work_queue = + create_workqueue("hv_vmbus_rescind"); + if (!vmbus_connection.rescind_work_queue) { + ret = -ENOMEM; + goto cleanup; + } + vmbus_connection.ignore_any_offer_msg = false; + vmbus_connection.handle_primary_chan_wq = create_workqueue("hv_pri_chan"); if (!vmbus_connection.handle_primary_chan_wq) { @@ -357,6 +365,9 @@ void vmbus_disconnect(void) if (vmbus_connection.handle_primary_chan_wq) destroy_workqueue(vmbus_connection.handle_primary_chan_wq); + if (vmbus_connection.rescind_work_queue) + destroy_workqueue(vmbus_connection.rescind_work_queue); + if (vmbus_connection.work_queue) destroy_workqueue(vmbus_connection.work_queue); |