From nobody Mon Sep 15 02:00:24 2025 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 4468CC46467 for ; Mon, 16 Jan 2023 17:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234160AbjAPRIJ (ORCPT ); Mon, 16 Jan 2023 12:08:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232398AbjAPRHm (ORCPT ); Mon, 16 Jan 2023 12:07:42 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B12145214; Mon, 16 Jan 2023 08:48:14 -0800 (PST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id F03AB20DFE78; Mon, 16 Jan 2023 08:48:12 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F03AB20DFE78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1673887693; bh=830ratWRS4bQzvHuTEiO0/aT5X4L/o09Ymakf+Mlji4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YZNCE0gJDenDx4coBi2dBoU62ioG8/B8kXEr26IWl72tySAGQXvv5wBWdKVFiRulw 8xhGeDoW6NqGRHcmJ5yrLl/ETL2IkuZM7qTDTfm0qxvUxCEsw3io7jubu86hCpO2pn KrWIQ8h54SHQ/gNU90qW2ooMCEf8S+RYCmvQA9EI= From: Saurabh Sengar To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, daniel.lezcano@linaro.org, tglx@linutronix.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, mikelley@microsoft.com, ssengar@microsoft.com Subject: [PATCH 1/4] drivers/clocksource/hyper-v: non ACPI support in hyperv clock Date: Mon, 16 Jan 2023 08:48:05 -0800 Message-Id: <1673887688-19151-2-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673887688-19151-1-git-send-email-ssengar@linux.microsoft.com> References: <1673887688-19151-1-git-send-email-ssengar@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add a placeholder function for the hv_setup_stimer0_irq API to accommodate systems without ACPI support. Since this function is not utilized on x86/x64 systems and non-ACPI support is only intended for x86/x64 systems, a placeholder function is sufficient for now and can be improved upon if necessary in the future This change will make it easier to add device tree support for VMBus in subsequent commits. Signed-off-by: Saurabh Sengar --- drivers/clocksource/hyperv_timer.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyper= v_timer.c index c0cef92..f32948c 100644 --- a/drivers/clocksource/hyperv_timer.c +++ b/drivers/clocksource/hyperv_timer.c @@ -49,7 +49,7 @@ =20 static int stimer0_irq =3D -1; static int stimer0_message_sint; -static DEFINE_PER_CPU(long, stimer0_evt); +static __maybe_unused DEFINE_PER_CPU(long, stimer0_evt); =20 /* * Common code for stimer0 interrupts coming via Direct Mode or @@ -68,7 +68,7 @@ void hv_stimer0_isr(void) * stimer0 interrupt handler for architectures that support * per-cpu interrupts, which also implies Direct Mode. */ -static irqreturn_t hv_stimer0_percpu_isr(int irq, void *dev_id) +static irqreturn_t __maybe_unused hv_stimer0_percpu_isr(int irq, void *dev= _id) { hv_stimer0_isr(); return IRQ_HANDLED; @@ -196,6 +196,7 @@ void __weak hv_remove_stimer0_handler(void) { }; =20 +#ifdef CONFIG_ACPI /* Called only on architectures with per-cpu IRQs (i.e., not x86/x64) */ static int hv_setup_stimer0_irq(void) { @@ -230,6 +231,16 @@ static void hv_remove_stimer0_irq(void) stimer0_irq =3D -1; } } +#else +static int hv_setup_stimer0_irq(void) +{ + return 0; +} + +static void hv_remove_stimer0_irq(void) +{ +} +#endif =20 /* hv_stimer_alloc - Global initialization of the clockevent and stimer0 */ int hv_stimer_alloc(bool have_percpu_irqs) --=20 1.8.3.1 From nobody Mon Sep 15 02:00:24 2025 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 8F3DCC677F1 for ; Mon, 16 Jan 2023 17:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234152AbjAPRIM (ORCPT ); Mon, 16 Jan 2023 12:08:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232468AbjAPRHm (ORCPT ); Mon, 16 Jan 2023 12:07:42 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B2DD45216; Mon, 16 Jan 2023 08:48:14 -0800 (PST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 1483D20DFE79; Mon, 16 Jan 2023 08:48:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1483D20DFE79 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1673887693; bh=JZq9G5MlrIm9vmsNAI+byLNXbxxsM+mcQ1O6doawohU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DM6T02C13nUQxv9ynrGjywSQSw3cYMHP0HQEhBzbYKhx7W/K+tUgLuceXmjtWtQ+B G1zGkFR8XgmvxNvk+OOKGm4VeDqhnuB/nXVsNIPIrorfi8PBErI2UcCZj5CyRfnTId d+GkTyQyHD1ip4lyYRSSPaOY5WurmpKZV6VBDSeg= From: Saurabh Sengar To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, daniel.lezcano@linaro.org, tglx@linutronix.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, mikelley@microsoft.com, ssengar@microsoft.com Subject: [PATCH 2/4] Drivers: hv: allow non ACPI compilation for hv_is_hibernation_supported Date: Mon, 16 Jan 2023 08:48:06 -0800 Message-Id: <1673887688-19151-3-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673887688-19151-1-git-send-email-ssengar@linux.microsoft.com> References: <1673887688-19151-1-git-send-email-ssengar@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" acpi_sleep_state_supported API is only define for CONFIG_ACPI flag and thus it can't be used for non-ACPI builds. Initaly there won't be hibernate support for non ACPI builds. This change will help adding device tree support in subsequent commits. Signed-off-by: Saurabh Sengar --- drivers/hv/hv_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c index 52a6f89..370ec20 100644 --- a/drivers/hv/hv_common.c +++ b/drivers/hv/hv_common.c @@ -234,7 +234,11 @@ void hv_setup_dma_ops(struct device *dev, bool coheren= t) =20 bool hv_is_hibernation_supported(void) { +#ifdef CONFIG_ACPI return !hv_root_partition && acpi_sleep_state_supported(ACPI_STATE_S4); +#else + return false; +#endif } EXPORT_SYMBOL_GPL(hv_is_hibernation_supported); =20 --=20 1.8.3.1 From nobody Mon Sep 15 02:00:24 2025 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 637DAC67871 for ; Mon, 16 Jan 2023 17:09:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234288AbjAPRIh (ORCPT ); Mon, 16 Jan 2023 12:08:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234076AbjAPRHo (ORCPT ); Mon, 16 Jan 2023 12:07:44 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 29B954521A; Mon, 16 Jan 2023 08:48:14 -0800 (PST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 2C2C220DFE7A; Mon, 16 Jan 2023 08:48:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2C2C220DFE7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1673887693; bh=/erGmO9YBydy1+czkGczqNFZxOgb8gfFMFeWHJ3yvbM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kRkQECdyTuQedMcWTjlxERbl4mTCPSNyziAnxJTFHgzad4olzatgmysPgcb9OV8JB OZ3vDKrVg/7lV6ZfkowN6jqB/M8C5N/trKeNCH7RZcd7TIfMW9KS2JggGEYJBmxSP1 gr5475MRiSItTAMBjiY0vOWjZnIBE6A9TCdHNW8U= From: Saurabh Sengar To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, daniel.lezcano@linaro.org, tglx@linutronix.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, mikelley@microsoft.com, ssengar@microsoft.com Subject: [PATCH 3/4] Drivers: hv: vmbus: Device Tree support Date: Mon, 16 Jan 2023 08:48:07 -0800 Message-Id: <1673887688-19151-4-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673887688-19151-1-git-send-email-ssengar@linux.microsoft.com> References: <1673887688-19151-1-git-send-email-ssengar@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Update the driver to use vmbus_root_dev device instead of acpi_device, which can be assigned to either ACPI or OF device, making VMBus agnostic to whether the device is using ACPI or device tree. When built for OF, the driver registers as a platform driver and includes a 'of' probe function that is alternate to the existing ACPI registration and probe when built for ACPI. The VMBus driver maintains its registration as the bus that other VMBus devices plug into, regardless of whether it is initially probed and initialized via ACPI or OF. This change also introduce vmbus_remove_mmio function, which helps removing the duplicate code for mmio cleanup between APIC and OF driver. Signed-off-by: Saurabh Sengar --- drivers/hv/vmbus_drv.c | 190 ++++++++++++++++++++++++++++++++++++++++-----= ---- 1 file changed, 155 insertions(+), 35 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 1901556..894b360 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -11,11 +11,13 @@ =20 #include #include -#include +#include #include #include #include #include +#include +#include #include #include #include @@ -44,14 +46,14 @@ struct vmbus_dynid { struct hv_vmbus_device_id id; }; =20 -static struct acpi_device *hv_acpi_dev; - static int hyperv_cpuhp_online; =20 static void *hv_panic_page; =20 static long __percpu *vmbus_evt; =20 +static struct device *vmbus_root_dev; + /* Values parsed from ACPI DSDT */ int vmbus_irq; int vmbus_interrupt; @@ -136,17 +138,13 @@ static int hv_die_panic_notify_crash(struct notifier_= block *self, return NOTIFY_DONE; } =20 -static const char *fb_mmio_name =3D "fb_range"; static struct resource *fb_mmio; static struct resource *hyperv_mmio; static DEFINE_MUTEX(hyperv_mmio_lock); =20 static int vmbus_exists(void) { - if (hv_acpi_dev =3D=3D NULL) - return -ENODEV; - - return 0; + return vmbus_root_dev ? 0 : -ENODEV; } =20 static u8 channel_monitor_group(const struct vmbus_channel *channel) @@ -932,7 +930,7 @@ static int vmbus_dma_configure(struct device *child_dev= ice) * On x86/x64 coherence is assumed and these calls have no effect. */ hv_setup_dma_ops(child_device, - device_get_dma_attr(&hv_acpi_dev->dev) =3D=3D DEV_DMA_COHERENT); + device_get_dma_attr(vmbus_root_dev) =3D=3D DEV_DMA_COHERENT); return 0; } =20 @@ -2090,7 +2088,7 @@ int vmbus_device_register(struct hv_device *child_dev= ice_obj) &child_device_obj->channel->offermsg.offer.if_instance); =20 child_device_obj->device.bus =3D &hv_bus; - child_device_obj->device.parent =3D &hv_acpi_dev->dev; + child_device_obj->device.parent =3D vmbus_root_dev; child_device_obj->device.release =3D vmbus_device_release; =20 child_device_obj->device.dma_parms =3D &child_device_obj->dma_parms; @@ -2151,7 +2149,26 @@ void vmbus_device_unregister(struct hv_device *devic= e_obj) device_unregister(&device_obj->device); } =20 +static void vmbus_remove_mmio(void) +{ + struct resource *cur_res; + struct resource *next_res; + + if (hyperv_mmio) { + if (fb_mmio) { + __release_region(hyperv_mmio, fb_mmio->start, + resource_size(fb_mmio)); + fb_mmio =3D NULL; + } + + for (cur_res =3D hyperv_mmio; cur_res; cur_res =3D next_res) { + next_res =3D cur_res->sibling; + kfree(cur_res); + } + } +} =20 +#ifdef CONFIG_ACPI /* * VMBUS is an acpi enumerated device. Get the information we * need from DSDT. @@ -2264,21 +2281,7 @@ static acpi_status vmbus_walk_resources(struct acpi_= resource *res, void *ctx) =20 static void vmbus_acpi_remove(struct acpi_device *device) { - struct resource *cur_res; - struct resource *next_res; - - if (hyperv_mmio) { - if (fb_mmio) { - __release_region(hyperv_mmio, fb_mmio->start, - resource_size(fb_mmio)); - fb_mmio =3D NULL; - } - - for (cur_res =3D hyperv_mmio; cur_res; cur_res =3D next_res) { - next_res =3D cur_res->sibling; - kfree(cur_res); - } - } + vmbus_remove_mmio(); } =20 static void vmbus_reserve_fb(void) @@ -2319,8 +2322,9 @@ static void vmbus_reserve_fb(void) * reserving a larger area and make it smaller until it succeeds. */ for (; !fb_mmio && (size >=3D 0x100000); size >>=3D 1) - fb_mmio =3D __request_region(hyperv_mmio, start, size, fb_mmio_name, 0); + fb_mmio =3D __request_region(hyperv_mmio, start, size, "fb_range", 0); } +#endif /* CONFIG_ACPI */ =20 /** * vmbus_allocate_mmio() - Pick a memory-mapped I/O range. @@ -2441,13 +2445,14 @@ void vmbus_free_mmio(resource_size_t start, resourc= e_size_t size) } EXPORT_SYMBOL_GPL(vmbus_free_mmio); =20 +#ifdef CONFIG_ACPI static int vmbus_acpi_add(struct acpi_device *device) { acpi_status result; int ret_val =3D -ENODEV; struct acpi_device *ancestor; =20 - hv_acpi_dev =3D device; + vmbus_root_dev =3D &device->dev; =20 /* * Older versions of Hyper-V for ARM64 fail to include the _CCA @@ -2492,6 +2497,72 @@ static int vmbus_acpi_add(struct acpi_device *device) vmbus_acpi_remove(device); return ret_val; } +#endif + +#ifdef CONFIG_OF +static int vmbus_of_driver_probe(struct platform_device *dev) +{ + struct resource **cur_res =3D &hyperv_mmio; + struct device_node *np; + const __be32 *ranges; + u32 nr_addr, nr_size, nr_parent_addr_cells, nr_ranges; + u32 range_len, range_size; + int i; + + vmbus_root_dev =3D &dev->dev; + np =3D vmbus_root_dev->of_node; + + if (of_property_read_u32(np, "#address-cells", &nr_addr)) + return -ENOENT; + if (of_property_read_u32(np, "#size-cells", &nr_size)) + return -ENOENT; + nr_parent_addr_cells =3D of_n_addr_cells(np); + + if (nr_parent_addr_cells !=3D 2 || nr_addr !=3D 2 || nr_size !=3D 1) { + pr_err("Address format is not supported\n"); + return -EINVAL; + } + + ranges =3D of_get_property(np, "ranges", &range_len); + if (!ranges) + return -ENOENT; + + range_size =3D nr_parent_addr_cells + nr_addr + nr_size; // in cells + nr_ranges =3D range_len / sizeof(__be32) / range_size; + + for (i =3D 0; i < nr_ranges; ++i, ranges +=3D range_size) { + struct resource *res; + /* + * The first u64 in the ranges description isn't used currently. + * u64 _ =3D of_read_number(ranges, nr_parent_addr_cells); + */ + u64 start =3D of_read_number(ranges + nr_parent_addr_cells, nr_addr); + u32 len =3D of_read_number(ranges + nr_parent_addr_cells + nr_addr, nr_s= ize); + + pr_debug("VMBUS DeviceTree MMIO region start %#llx, %#x\n", start, len); + + res =3D kzalloc(sizeof(*res), GFP_ATOMIC); + if (!res) + return -ENOMEM; + + res->name =3D "hyperv mmio"; + res->flags =3D IORESOURCE_MEM | IORESOURCE_MEM_64; + res->start =3D start; + res->end =3D start + len; + + *cur_res =3D res; + cur_res =3D &res->sibling; + } + + return 0; +} + +static int vmbus_of_driver_remove(struct platform_device *dev) +{ + vmbus_remove_mmio(); + return 0; +} +#endif =20 #ifdef CONFIG_PM_SLEEP static int vmbus_bus_suspend(struct device *dev) @@ -2630,6 +2701,9 @@ static int vmbus_bus_resume(struct device *dev) #define vmbus_bus_resume NULL #endif /* CONFIG_PM_SLEEP */ =20 +#define DRV_NAME "vmbus" + +#ifdef CONFIG_ACPI static const struct acpi_device_id vmbus_acpi_device_ids[] =3D { {"VMBUS", 0}, {"VMBus", 0}, @@ -2659,7 +2733,7 @@ static int vmbus_bus_resume(struct device *dev) }; =20 static struct acpi_driver vmbus_acpi_driver =3D { - .name =3D "vmbus", + .name =3D DRV_NAME, .ids =3D vmbus_acpi_device_ids, .ops =3D { .add =3D vmbus_acpi_add, @@ -2669,6 +2743,7 @@ static int vmbus_bus_resume(struct device *dev) .drv.probe_type =3D PROBE_FORCE_SYNCHRONOUS, }; =20 +#endif static void hv_kexec_handler(void) { hv_stimer_global_cleanup(); @@ -2737,7 +2812,32 @@ static void hv_synic_resume(void) .resume =3D hv_synic_resume, }; =20 -static int __init hv_acpi_init(void) +#ifdef CONFIG_OF +static const struct of_device_id vmbus_of_match[] =3D { + { + .name =3D "msft,vmbus", + .compatible =3D "msft,vmbus", + .data =3D NULL + }, + { + /* sentinel */ + }, +}; +MODULE_DEVICE_TABLE(of, vmbus_of_match); + +static struct platform_driver vmbus_platform_driver =3D { + .probe =3D vmbus_of_driver_probe, + .remove =3D vmbus_of_driver_remove, + .driver =3D { + .name =3D DRV_NAME, + .of_match_table =3D of_match_ptr(vmbus_of_match), + .pm =3D &vmbus_pm, + .bus =3D &hv_bus, + } +}; +#endif + +static int __init vmbus_init(void) { int ret; =20 @@ -2747,18 +2847,27 @@ static int __init hv_acpi_init(void) if (hv_root_partition && !hv_nested) return 0; =20 +#ifdef CONFIG_ACPI /* - * Get ACPI resources first. + * Request ACPI resources and wait for the completion */ ret =3D acpi_bus_register_driver(&vmbus_acpi_driver); =20 if (ret) return ret; =20 - if (!hv_acpi_dev) { - ret =3D -ENODEV; + if (!vmbus_root_dev) { + ret =3D -ETIMEDOUT; goto cleanup; } +#endif +#ifdef CONFIG_OF + ret =3D platform_driver_register(&vmbus_platform_driver); + if (ret) { + pr_err("Error registering platform resources: %d\n", ret); + goto cleanup; + } +#endif =20 /* * If we're on an architecture with a hardcoded hypervisor @@ -2785,8 +2894,14 @@ static int __init hv_acpi_init(void) return 0; =20 cleanup: +#ifdef CONFIG_ACPI acpi_bus_unregister_driver(&vmbus_acpi_driver); - hv_acpi_dev =3D NULL; +#endif +#ifdef CONFIG_OF + platform_driver_unregister(&vmbus_platform_driver); +#endif + vmbus_root_dev =3D NULL; + return ret; } =20 @@ -2839,12 +2954,17 @@ static void __exit vmbus_exit(void) =20 cpuhp_remove_state(hyperv_cpuhp_online); hv_synic_free(); +#ifdef CONFIG_ACPI acpi_bus_unregister_driver(&vmbus_acpi_driver); +#endif +#ifdef CONFIG_OF + platform_driver_unregister(&vmbus_platform_driver); +#endif + vmbus_root_dev =3D NULL; } =20 - MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Microsoft Hyper-V VMBus Driver"); =20 -subsys_initcall(hv_acpi_init); +subsys_initcall(vmbus_init); module_exit(vmbus_exit); --=20 1.8.3.1 From nobody Mon Sep 15 02:00:24 2025 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 4DE46C54EBE for ; Mon, 16 Jan 2023 17:09:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233244AbjAPRI3 (ORCPT ); Mon, 16 Jan 2023 12:08:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233970AbjAPRHn (ORCPT ); Mon, 16 Jan 2023 12:07:43 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 29823442FC; Mon, 16 Jan 2023 08:48:14 -0800 (PST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 4440B20DFE7B; Mon, 16 Jan 2023 08:48:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4440B20DFE7B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1673887693; bh=8WJ4zN5MuJ/C11+0ipegAO1si9SMvqeWNRylUa8fNzc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SjlDDfFhL9lfRd/aAv5hJ1HJ4R9srUQcXj9teGHm7+UGQLoLW1dy6/XPfY07mR9Ra DEKKMNkKJvFKNbdBLAoKIa5nt3aDtEyKsM+wZm50Hz7rHu/8FO3BKNEzpDP566/I9I QZPbBRsm8wDewAHHWkZxzmZQpq2ZxomBKn5QF3G4= From: Saurabh Sengar To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, daniel.lezcano@linaro.org, tglx@linutronix.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, mikelley@microsoft.com, ssengar@microsoft.com Subject: [PATCH 4/4] dt-bindings: hv: Add dt-bindings for VMBus Date: Mon, 16 Jan 2023 08:48:08 -0800 Message-Id: <1673887688-19151-5-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673887688-19151-1-git-send-email-ssengar@linux.microsoft.com> References: <1673887688-19151-1-git-send-email-ssengar@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add dt-bindings for Hyper-V VMBus Signed-off-by: Saurabh Sengar --- .../devicetree/bindings/hv/msft,vmbus.yaml | 34 ++++++++++++++++++= ++++ 1 file changed, 34 insertions(+) create mode 100644 Documentation/devicetree/bindings/hv/msft,vmbus.yaml diff --git a/Documentation/devicetree/bindings/hv/msft,vmbus.yaml b/Documen= tation/devicetree/bindings/hv/msft,vmbus.yaml new file mode 100644 index 0000000..66cb426 --- /dev/null +++ b/Documentation/devicetree/bindings/hv/msft,vmbus.yaml @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/hv/msft,vmbus.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microsoft Hyper-V VMBus device tree bindings + +maintainers: + - Saurabh Sengar + +description: + VMBus is a software bus that implement the protocols for communication + between the root or host OS and guest OSs (virtual machines). + +properties: + compatible: + const: msft,vmbus + + ranges : + const: <0x00 0x00 0x0f 0xf0000000 0x10000000> + +required: + - compatible + - ranges + +examples: + - | + vmbus { + #address-cells =3D <0x02>; + #size-cells =3D <0x01>; + compatible =3D "msft,vmbus"; + ranges =3D <0x00 0x00 0x0f 0xf0000000 0x10000000>; + }; --=20 1.8.3.1