summaryrefslogtreecommitdiff
path: root/drivers/hv/connection.c
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2019-09-06 02:01:21 +0300
committerSasha Levin <sashal@kernel.org>2019-09-06 21:52:44 +0300
commitb307b38962eb0f22d1aa6dcf53cb7d3c2ed5eec7 (patch)
tree38f55d99f6960a7738cb8af94ce4837de60b2444 /drivers/hv/connection.c
parent1f48dcf180e5422b1a633b24680dd0f5c3f540f5 (diff)
downloadlinux-b307b38962eb0f22d1aa6dcf53cb7d3c2ed5eec7.tar.xz
Drivers: hv: vmbus: Suspend after cleaning up hv_sock and sub channels
Before suspend, Linux must make sure all the hv_sock channels have been properly cleaned up, because a hv_sock connection can not persist across hibernation, and the user-space app must be properly notified of the state change of the connection. Before suspend, Linux also must make sure all the sub-channels have been destroyed, i.e. the related channel structs of the sub-channels must be properly removed, otherwise they would cause a conflict when the sub-channels are recreated upon resume. Add a counter to track such channels, and vmbus_bus_suspend() should wait for the counter to drop to zero. Signed-off-by: Dexuan Cui <decui@microsoft.com> Reviewed-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hv/connection.c')
-rw-r--r--drivers/hv/connection.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 806319cd5ccf..99851ea682eb 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -26,6 +26,9 @@
struct vmbus_connection vmbus_connection = {
.conn_state = DISCONNECTED,
.next_gpadl_handle = ATOMIC_INIT(0xE1E10),
+
+ .ready_for_suspend_event= COMPLETION_INITIALIZER(
+ vmbus_connection.ready_for_suspend_event),
};
EXPORT_SYMBOL_GPL(vmbus_connection);