Skip to content

Commit fcf5203

Browse files
jstarksliuw
authored andcommitted
Drivers: hv: vmbus: Log on missing offers if any
When resuming from hibernation, log any channels that were present before hibernation but now are gone. In general, the boot-time devices configured for a resuming VM should be the same as the devices in the VM at the time of hibernation. It's uncommon for the configuration to have been changed such that offers are missing. Changing the configuration violates the rules for hibernation anyway. The cleanup of missing channels is not straight-forward and dependent on individual device driver functionality and implementation, so it can be added in future with separate changes. Signed-off-by: John Starks <[email protected]> Co-developed-by: Naman Jain <[email protected]> Signed-off-by: Naman Jain <[email protected]> Reviewed-by: Easwar Hariharan <[email protected]> Reviewed-by: Saurabh Sengar <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wei Liu <[email protected]> Message-ID: <[email protected]>
1 parent 113386c commit fcf5203

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/hv/vmbus_drv.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,6 +2462,7 @@ static int vmbus_bus_suspend(struct device *dev)
24622462

24632463
static int vmbus_bus_resume(struct device *dev)
24642464
{
2465+
struct vmbus_channel *channel;
24652466
struct vmbus_channel_msginfo *msginfo;
24662467
size_t msgsize;
24672468
int ret;
@@ -2494,6 +2495,22 @@ static int vmbus_bus_resume(struct device *dev)
24942495

24952496
vmbus_request_offers();
24962497

2498+
mutex_lock(&vmbus_connection.channel_mutex);
2499+
list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
2500+
if (channel->offermsg.child_relid != INVALID_RELID)
2501+
continue;
2502+
2503+
/* hvsock channels are not expected to be present. */
2504+
if (is_hvsock_channel(channel))
2505+
continue;
2506+
2507+
pr_err("channel %pUl/%pUl not present after resume.\n",
2508+
&channel->offermsg.offer.if_type,
2509+
&channel->offermsg.offer.if_instance);
2510+
/* ToDo: Cleanup these channels here */
2511+
}
2512+
mutex_unlock(&vmbus_connection.channel_mutex);
2513+
24972514
/* Reset the event for the next suspend. */
24982515
reinit_completion(&vmbus_connection.ready_for_suspend_event);
24992516

0 commit comments

Comments
 (0)