]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Drivers: hv: vmbus: Wait for boot-time offers during boot and resume
authorNaman Jain <namjain@linux.microsoft.com>
Thu, 2 Jan 2025 13:07:10 +0000 (13:07 +0000)
committerWei Liu <wei.liu@kernel.org>
Fri, 10 Jan 2025 00:54:21 +0000 (00:54 +0000)
commit113386ca981c3997db6b83272c7ecf47456aeddb
tree95d6884a6a467f4bab2691256c070260ea316727
parent5fa1da972fcf503df4fa188a673cd5d09b60b090
Drivers: hv: vmbus: Wait for boot-time offers during boot and resume

Channel offers are requested during VMBus initialization and resume from
hibernation. Add support to wait for all boot-time channel offers to
be delivered and processed before returning from vmbus_request_offers.

This is in analogy to a PCI bus not returning from probe until it has
scanned all devices on the bus.

Without this, user mode can race with VMBus initialization and miss
channel offers. User mode has no way to work around this other than
sleeping for a while, since there is no way to know when VMBus has
finished processing boot-time offers.

With this added functionality, remove earlier logic which keeps track
of count of offered channels post resume from hibernation. Once all
offers delivered message is received, no further boot-time offers are
going to be received. Consequently, logic to prevent suspend from
happening after previous resume had missing offers, is also removed.

Co-developed-by: John Starks <jostarks@microsoft.com>
Signed-off-by: John Starks <jostarks@microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20250102130712.1661-2-namjain@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20250102130712.1661-2-namjain@linux.microsoft.com>
drivers/hv/channel_mgmt.c
drivers/hv/connection.c
drivers/hv/hyperv_vmbus.h
drivers/hv/vmbus_drv.c