diff options
author | Dexuan Cui <decui@microsoft.com> | 2019-09-05 23:01:22 +0000 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2019-09-06 14:52:44 -0400 |
commit | d8bd2d442bb2688b428ac7164e5dc6d95d4fa65b (patch) | |
tree | 5779d9e76257a90c457b183963a61117a05c033a /drivers/hv/hyperv_vmbus.h | |
parent | b307b38962eb0f22d1aa6dcf53cb7d3c2ed5eec7 (diff) | |
download | linux-d8bd2d442bb2688b428ac7164e5dc6d95d4fa65b.tar.gz linux-d8bd2d442bb2688b428ac7164e5dc6d95d4fa65b.tar.bz2 linux-d8bd2d442bb2688b428ac7164e5dc6d95d4fa65b.zip |
Drivers: hv: vmbus: Resume after fixing up old primary channels
When the host re-offers the primary channels upon resume, the host only
guarantees the Instance GUID doesn't change, so vmbus_bus_suspend()
should invalidate channel->offermsg.child_relid and figure out the
number of primary channels that need to be fixed up upon resume.
Upon resume, vmbus_onoffer() finds the old channel structs, and maps
the new offers to the old channels, and fixes up the old structs,
and finally the resume callbacks of the VSC drivers will re-open
the channels.
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/hyperv_vmbus.h')
-rw-r--r-- | drivers/hv/hyperv_vmbus.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 974b747ca1fc..f7a5f5615f34 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -272,6 +272,20 @@ struct vmbus_connection { * drop to zero. */ struct completion ready_for_suspend_event; + + /* + * The number of primary channels that should be "fixed up" + * upon resume: these channels are re-offered upon resume, and some + * fields of the channel offers (i.e. child_relid and connection_id) + * can change, so the old offermsg must be fixed up, before the resume + * callbacks of the VSC drivers start to further touch the channels. + */ + atomic_t nr_chan_fixup_on_resume; + /* + * vmbus_bus_resume() waits for "nr_chan_fixup_on_resume" to + * drop to zero. + */ + struct completion ready_for_resume_event; }; |