Skip to content

Commit

Permalink
hv_sock: Add the support of hibernation
Browse files Browse the repository at this point in the history
Add the necessary dummy callbacks for hibernation.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dexuan Cui authored and Sasha Levin committed Nov 4, 2019
1 parent 824946a commit 3bb673b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions net/vmw_vsock/hyperv_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,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[] = {
{},
Expand All @@ -949,6 +967,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)
Expand Down

0 comments on commit 3bb673b

Please sign in to comment.