From nobody Thu Apr 2 19:48:41 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EFB2C6FA82 for ; Wed, 21 Sep 2022 18:39:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbiIUSjK (ORCPT ); Wed, 21 Sep 2022 14:39:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiIUSjH (ORCPT ); Wed, 21 Sep 2022 14:39:07 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC6EAA0316; Wed, 21 Sep 2022 11:39:06 -0700 (PDT) Received: from skinsburskii-cloud-desktop.internal.cloudapp.net (unknown [20.14.88.254]) by linux.microsoft.com (Postfix) with ESMTPSA id 3B448205D10E; Wed, 21 Sep 2022 11:39:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3B448205D10E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1663785546; bh=nmCc3UD/Zke6v9UtckBzTcZfSDMVeN9H7aJMP3kVrF8=; h=Subject:From:To:Cc:Date:From; b=qcpxKcNRxybVStd/mmCLR+4fP87jT9BEYYNTL0o8ij7x9lw9101q2HZvrFIi9CpWB GFSkKgrI9jOVn/+PasebnRhwcwSJJD5kNvDqmUSNLHDXOLHnHz8gjR8OjJ7WGF9Xv7 eHTW/7GNXAXK9KMOuhMjVml1F9Tp13GJmLTh3zJw= Subject: [PATCH] Drivers: hv: vmbus: Don't wait for the ACPI device upon initialization From: Stanislav Kinsburskii To: skinsburskii@microsoft.com Cc: Stanislav Kinsburskiy , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 21 Sep 2022 18:39:05 +0000 Message-ID: <166378554568.581670.1124852716698789244.stgit@skinsburskii-cloud-desktop.internal.cloudapp.net> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stanislav Kinsburskiy Waiting to 5 seconds in case of missing VMBUS ACPI device is redundant as t= he 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 CC: "K. Y. Srinivasan" CC: Haiyang Zhang CC: Stephen Hemminger CC: Wei Liu CC: Dexuan Cui CC: linux-hyperv@vger.kernel.org CC: linux-kernel@vger.kernel.org Reviewed-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/vmbus_drv.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 7b9f3fc3adf7..32d0009631a6 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -46,8 +46,6 @@ struct vmbus_dynid { =20 static struct acpi_device *hv_acpi_dev; =20 -static struct completion probe_event; - static int hyperv_cpuhp_online; =20 static void *hv_panic_page; @@ -2468,7 +2466,6 @@ static int vmbus_acpi_add(struct acpi_device *device) ret_val =3D 0; =20 acpi_walk_err: - complete(&probe_event); if (ret_val) vmbus_acpi_remove(device); return ret_val; @@ -2647,6 +2644,7 @@ static struct acpi_driver vmbus_acpi_driver =3D { .remove =3D vmbus_acpi_remove, }, .drv.pm =3D &vmbus_bus_pm, + .drv.probe_type =3D PROBE_FORCE_SYNCHRONOUS, }; =20 static void hv_kexec_handler(void) @@ -2719,7 +2717,7 @@ static struct syscore_ops hv_synic_syscore_ops =3D { =20 static int __init hv_acpi_init(void) { - int ret, t; + int ret; =20 if (!hv_is_hyperv_initialized()) return -ENODEV; @@ -2727,8 +2725,6 @@ static int __init hv_acpi_init(void) if (hv_root_partition) return 0; =20 - init_completion(&probe_event); - /* * Get ACPI resources first. */ @@ -2737,9 +2733,8 @@ static int __init hv_acpi_init(void) if (ret) return ret; =20 - t =3D wait_for_completion_timeout(&probe_event, 5*HZ); - if (t =3D=3D 0) { - ret =3D -ETIMEDOUT; + if (!hv_acpi_dev) { + ret =3D -ENODEV; goto cleanup; }