Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1147672rwb; Thu, 22 Sep 2022 10:42:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75E3scbt2KyJz0NQtkGRguJCBd2n2nx+zaHDtlhEXXq3XWMixGyB02kYjIIFuoFFZqJdws X-Received: by 2002:a17:907:2cea:b0:77c:59aa:c00f with SMTP id hz10-20020a1709072cea00b0077c59aac00fmr3841845ejc.73.1663868538471; Thu, 22 Sep 2022 10:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663868538; cv=none; d=google.com; s=arc-20160816; b=WrlDGUDBoFpAMBGPZsiHghY1h9G1pcUvswMW25hQo3dZMaJRzJtfNz1rTPIG61kFDs Vwav1WMRhKSP+RjNJPqjj58G4NgNOUeNNHmw9gdZ7y56ezNqGoRxxha84dVaP5TMeqSI 8bXPxM0+8DZdZ9VywBK6Jt188PICpPYQrATi9oIkrGn3R+/G9fT41okN8facr02gG6XQ 163dkjL2APWwj/iZXEUHvQxkJWdtrUR7Q0zZf27GluIgnm4xMQgbICsaJA2FEI9yB8Ms 3vGL/NTcF/ZJBmOT6H5pv96e9ftZ48bRRe8i+9RbaARp34MP6cs1sR/K5FG5Gx3t71tI oqwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=5hiam4Rd+NTu+6XogJRYY70Z3eZ5FhQLv+wWdqT3ju0=; b=bwiEpXNnUuWb2UMwcEtMDqkJlQpjuitIkHH9P9QsjgUWPp5VmxXwJ6f21Q4JjspgrW +gEyaRokdfIoxLqn9fYK9XHQg0pKwDSrwZiapnaUSVERhDXL1nQb53bsV+espzeVbBTA a0u51/6Y5/VyREGtzW/e8koRODGq3uvDx4D8asDry3SzNnxXjjv+UckVaj1BpZyAQ+sf zJFmxy5hm8I3jyXhohuzgZSEtYUBBvciM0taAlp3ZP929jwSkIrArPxDSJ0a9lo523tP ua10fbOidOZKLUPkptEuluMXLUa4WsHM+9bZDwRUZ8ZzaIgOxI8E2c/pA6lhOcyb9AuV iGxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd41-20020a1709076e2900b0073d74bcac8dsi4065916ejc.513.2022.09.22.10.41.52; Thu, 22 Sep 2022 10:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231597AbiIVRTs (ORCPT + 99 others); Thu, 22 Sep 2022 13:19:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231391AbiIVRTq (ORCPT ); Thu, 22 Sep 2022 13:19:46 -0400 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15181397; Thu, 22 Sep 2022 10:19:45 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id y5so16662931wrh.3; Thu, 22 Sep 2022 10:19:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=5hiam4Rd+NTu+6XogJRYY70Z3eZ5FhQLv+wWdqT3ju0=; b=inGa3thtRL4uP0gidHG0ExHCh5BVWfUhNEALcEQAysNgVibS98UB5zUFRLpRnyhtP0 vGyKKXeFruoCy6rR9sEhDVLZcE8j+E/GDCtiTP9e0B5r5HumBx29+VIOuN182KHiX2Vi svsj5vlP6DJ99pRdwATUhg1XIkuTczj+VADTX89i/3J1PKM3TwK52y0eH40L4yvQ67GC njoCLRG7v0RhEHYo7y6wNpeoICfhkJGP5xyK9oVbTOV7/rMPBmxxbnlyadHWidLDMMo+ QpWCBu/iXGwUvlRsIZMelwHIRlRpw42rH1FjBWg8P8ukDovCsCWv33KDl2nmOrVqOyM1 u3vg== X-Gm-Message-State: ACrzQf0C/6F7DWUbaUKQFyBLrlbVavcbRZdgAB7lntQCbAcI2LI8b992 AAxkhE2n/cRDivR00aQR/OAdkcWfp2M= X-Received: by 2002:a5d:4247:0:b0:22a:df99:ce06 with SMTP id s7-20020a5d4247000000b0022adf99ce06mr2863743wrr.513.1663867183258; Thu, 22 Sep 2022 10:19:43 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id q16-20020a1cf310000000b003a5fa79007fsm150268wmq.7.2022.09.22.10.19.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 10:19:42 -0700 (PDT) Date: Thu, 22 Sep 2022 17:19:40 +0000 From: Wei Liu To: Stanislav Kinsburskii Cc: skinsburskii@microsoft.com, Stanislav Kinsburskiy , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Kelley Subject: Re: [PATCH] Drivers: hv: vmbus: Don't wait for the ACPI device upon initialization Message-ID: References: <166378554568.581670.1124852716698789244.stgit@skinsburskii-cloud-desktop.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <166378554568.581670.1124852716698789244.stgit@skinsburskii-cloud-desktop.internal.cloudapp.net> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 21, 2022 at 06:39:05PM +0000, Stanislav Kinsburskii wrote: > From: Stanislav Kinsburskiy > > 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 > 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 Looks good to me. I will wait for a few days for others to chime in. CC Michael. > --- > 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 { > > static struct acpi_device *hv_acpi_dev; > > -static struct completion probe_event; > - > static int hyperv_cpuhp_online; > > static void *hv_panic_page; > @@ -2468,7 +2466,6 @@ static int vmbus_acpi_add(struct acpi_device *device) > ret_val = 0; > > 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 = { > .remove = vmbus_acpi_remove, > }, > .drv.pm = &vmbus_bus_pm, > + .drv.probe_type = PROBE_FORCE_SYNCHRONOUS, > }; > > static void hv_kexec_handler(void) > @@ -2719,7 +2717,7 @@ static struct syscore_ops hv_synic_syscore_ops = { > > static int __init hv_acpi_init(void) > { > - int ret, t; > + int ret; > > if (!hv_is_hyperv_initialized()) > return -ENODEV; > @@ -2727,8 +2725,6 @@ static int __init hv_acpi_init(void) > if (hv_root_partition) > return 0; > > - init_completion(&probe_event); > - > /* > * Get ACPI resources first. > */ > @@ -2737,9 +2733,8 @@ static int __init hv_acpi_init(void) > if (ret) > return ret; > > - t = wait_for_completion_timeout(&probe_event, 5*HZ); > - if (t == 0) { > - ret = -ETIMEDOUT; > + if (!hv_acpi_dev) { > + ret = -ENODEV; > goto cleanup; > } > > >