diff mbox series

[v2] hv_sock: Add the support of hibernation

Message ID 1569447243-27433-1-git-send-email-decui@microsoft.com
State Not Applicable
Delegated to: David Miller
Headers show
Series [v2] hv_sock: Add the support of hibernation | expand

Commit Message

Dexuan Cui Sept. 25, 2019, 9:34 p.m. UTC
Add the necessary dummy callbacks for hibernation.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Acked-by: David S. Miller <davem@davemloft.net>
---

In v2:
    Added David's Acked-by.
    Removed [net-next] from the Subject.

    @Sasha, can you please pick this up into the hyper-v tree?

 net/vmw_vsock/hyperv_transport.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Dexuan Cui Sept. 27, 2019, 4:40 a.m. UTC | #1
> From: linux-hyperv-owner@vger.kernel.org
> <linux-hyperv-owner@vger.kernel.org> On Behalf Of kbuild test robot
> Sent: Thursday, September 26, 2019 9:19 PM
> 
> Hi Dexuan,
> 
> Thank you for the patch! Yet something to improve:
> 
> >> net//vmw_vsock/hyperv_transport.c:970:3: error: 'struct hv_driver' has no
> member named 'suspend'
>      .suspend = hvs_suspend,
>       ^~~~~~~

This is a false alarm. Your code base needs to be merged with the latest 
Linus's tree, which has the prerequisite patch:
271b2224d42f ("Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation")

Thanks,
-- Dexuan
Sasha Levin Oct. 1, 2019, 6:42 p.m. UTC | #2
On Wed, Sep 25, 2019 at 09:34:13PM +0000, Dexuan Cui wrote:
>Add the necessary dummy callbacks for hibernation.
>
>Signed-off-by: Dexuan Cui <decui@microsoft.com>
>Acked-by: David S. Miller <davem@davemloft.net>

Queued up for hyperv-next, thanks!

--
Thanks,
Sasha
diff mbox series

Patch

diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index f2084e3f7aa4..4c02e38aa728 100644
--- a/net/vmw_vsock/hyperv_transport.c
+++ b/net/vmw_vsock/hyperv_transport.c
@@ -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 forced 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 vmbus 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 struct hv_driver hvs_drv = {
 	.id_table	= id_table,
 	.probe		= hvs_probe,
 	.remove		= hvs_remove,
+	.suspend	= hvs_suspend,
+	.resume		= hvs_resume,
 };
 
 static int __init hvs_init(void)