Skip to content

Commit f7ac541

Browse files
skinsburskyliuw
authored andcommitted
Drivers: hv: vmbus: Don't wait for the ACPI device upon initialization
Waiting to 5 seconds in case of missing VMBus ACPI device is redundant as the device is either present already or won't be available at all. This patch enforces synchronous probing to make sure the bus traversal, happening upon driver registering will either find the device (if present) or not spend any additional time if device is absent. Signed-off-by: Stanislav Kinsburskiy <stanislav.kinsburskiy@gmail.com> CC: "K. Y. Srinivasan" <kys@microsoft.com> CC: Haiyang Zhang <haiyangz@microsoft.com> CC: Stephen Hemminger <sthemmin@microsoft.com> CC: Wei Liu <wei.liu@kernel.org> CC: Dexuan Cui <decui@microsoft.com> CC: linux-hyperv@vger.kernel.org CC: linux-kernel@vger.kernel.org Reviewed-by: Michael Kelley <mikelley@microsoft.com> Reviewed-by: Dexuan Cui <decui@microsoft.com> Link: https://lore.kernel.org/r/166378554568.581670.1124852716698789244.stgit@skinsburskii-cloud-desktop.internal.cloudapp.net Signed-off-by: Wei Liu <wei.liu@kernel.org>
1 parent a99aaf2 commit f7ac541

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

drivers/hv/vmbus_drv.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ struct vmbus_dynid {
4646

4747
static struct acpi_device *hv_acpi_dev;
4848

49-
static struct completion probe_event;
50-
5149
static int hyperv_cpuhp_online;
5250

5351
static void *hv_panic_page;
@@ -2467,7 +2465,6 @@ static int vmbus_acpi_add(struct acpi_device *device)
24672465
ret_val = 0;
24682466

24692467
acpi_walk_err:
2470-
complete(&probe_event);
24712468
if (ret_val)
24722469
vmbus_acpi_remove(device);
24732470
return ret_val;
@@ -2646,6 +2643,7 @@ static struct acpi_driver vmbus_acpi_driver = {
26462643
.remove = vmbus_acpi_remove,
26472644
},
26482645
.drv.pm = &vmbus_bus_pm,
2646+
.drv.probe_type = PROBE_FORCE_SYNCHRONOUS,
26492647
};
26502648

26512649
static void hv_kexec_handler(void)
@@ -2718,16 +2716,14 @@ static struct syscore_ops hv_synic_syscore_ops = {
27182716

27192717
static int __init hv_acpi_init(void)
27202718
{
2721-
int ret, t;
2719+
int ret;
27222720

27232721
if (!hv_is_hyperv_initialized())
27242722
return -ENODEV;
27252723

27262724
if (hv_root_partition)
27272725
return 0;
27282726

2729-
init_completion(&probe_event);
2730-
27312727
/*
27322728
* Get ACPI resources first.
27332729
*/
@@ -2736,9 +2732,8 @@ static int __init hv_acpi_init(void)
27362732
if (ret)
27372733
return ret;
27382734

2739-
t = wait_for_completion_timeout(&probe_event, 5*HZ);
2740-
if (t == 0) {
2741-
ret = -ETIMEDOUT;
2735+
if (!hv_acpi_dev) {
2736+
ret = -ENODEV;
27422737
goto cleanup;
27432738
}
27442739

0 commit comments

Comments
 (0)