Skip to contentSkip to conversation

hv_sock: Add the support of hibernation

PATCH In review Dexuan Cui 2 participants 3 messages Sep 11, 2019 – Sep 13, 2019

Subsystems (5)
lore
Share & tools
lore

Dexuan Cui

author maintainer
#0 lore raw

PATCH 1/1 hv_sock: Add the support of hibernation

Add the necessary dummy callbacks for hibernation.

---
This patch is basically a pure Hyper-V specific change and it has a build dependency on the commit 271b2224d42f ("Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation"), which is on Sasha Levin's Hyper-V tree's hyperv-next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git/log/?h=hyperv-next

I request this patch should go through Sasha's tree rather than the net-next tree.

 net/vmw_vsock/hyperv_transport.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
net/vmw_vsock/hyperv_transport.c +20 -0
index f2084e3..e91a884 100644
@@ -930,6 +930,24 @@ static int hvs_remove(struct hv_device *hdev)
 	return 0;
 }
 
+/* hv_sock connections can not persist across hibernation, and all the hv_sock
+ * channels are forceed to be rescinded before hibernation: see
+ * vmbus_bus_suspend(). Here the dummy hvs_suspend() and hvs_resume()
+ * are only needed because hibernation requires that every device's driver
+ * should have a .suspend and .resume callback: see vmbus_suspend().
+ */
+static int hvs_suspend(struct hv_device *hv_dev)
+{
+	/* Dummy */
+	return 0;
+}
+
+static int hvs_resume(struct hv_device *dev)
+{
+	/* Dummy */
+	return 0;
+}
+
 /* This isn't really used. See vmbus_match() and vmbus_probe() */
 static const struct hv_vmbus_device_id id_table[] = {
 	{},
@@ -941,6 +959,8 @@ static int hvs_remove(struct hv_device *hdev)
 	.id_table	= id_table,
 	.probe		= hvs_probe,
 	.remove		= hvs_remove,
+	.suspend	= hvs_suspend,
+	.resume		= hvs_resume,
 };
 
 static int __init hvs_init(void)
Signature · 1 line
1.8.3.1
maintainer Acked-by on v1 1/1
#1 lore raw

From: Dexuan Cui <[email protected]>
Date: Wed, 11 Sep 2019 23:37:27 +0000

Quoted 10 lines

Add the necessary dummy callbacks for hibernation.

---
This patch is basically a pure Hyper-V specific change and it has a build dependency on the commit 271b2224d42f ("Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation"), which is on Sasha Levin's Hyper-V tree's hyperv-next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git/log/?h=hyperv-next

Quoted 2 lines

I request this patch should go through Sasha's tree rather than the net-next tree.

That's fine:

author maintainer
#2 lore raw
Quoted 11 lines

From: David Miller <[email protected]>
Sent: Friday, September 13, 2019 1:04 PM

From: Dexuan Cui <[email protected]>
Date: Wed, 11 Sep 2019 23:37:27 +0000

Quoted 2 lines

I request this patch should go through Sasha's tree rather than the net-next tree.

That's fine:

Thanks, David!

@Sasha: I found a few typos in my comment below. I'll post a v2.

Quoted 2 lines
Quoted 2 lines

+/* hv_sock connections can not persist across hibernation, and all the hv_sock
+ * channels are forceed to be rescinded before hibernation: see

forceed -> forced

Quoted 1 line
Quoted 1 line

+ * are only needed because hibernation requires that every device's driver

every device's driver -> every vmbus device's driver

Thanks,
-- Dexuan