From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96701C25B75 for ; Wed, 15 May 2024 16:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T581x3bk6z6IQwYF4ZjSuPQIT9+xbNxfVYf1k0KZsSw=; b=HILnH5Uaztp/XR vHCElMfrTEowz/oMhj4cT/pynkRDuLheo8P4V3mYd7lnkJRdCO8932tdTwcwiWGxu4RxaMVSiFWmi FG2tGzo088HS0yIGAprXjl3xutP0dQI328U1k4RJCX12m1cD4oL1DJ1YFe3Cr3J4gWkp9+nhfa1Vx 1VRFRpfZC/GPFIvbzRjm7GVMvxMri+Hot3n7tZ8/2deHthLavwHw5AWzW/K2psO8Uhkl2pKfPumlM YiAn+fymDefDL0xI4K8zhS3uBN05hJ8CegsLNEDS5FnbZUGOrmDu/076WuO6Dnn10xKRaemqXINuO 5MO3QmUIosrz/D8Zi7FQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7HXl-000000027dc-3wZX; Wed, 15 May 2024 16:31:53 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7HXj-000000027cS-0cNZ for linux-arm-kernel@lists.infradead.org; Wed, 15 May 2024 16:31:52 +0000 Received: from [10.137.186.190] (unknown [131.107.159.62]) by linux.microsoft.com (Postfix) with ESMTPSA id A2FCF20B915A; Wed, 15 May 2024 09:31:48 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A2FCF20B915A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715790708; bh=zfT5j7bYJM4DBZSc/Ycy5/9qcDO07bVAvevEiPC83k8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jYM0jIAS40gZnVu5608YVfpID3a7+2njxvkoEidPMcsRJTvmB1BnJSa74t0o27bvo jzh+nEcM9FlOT9rA7SFJp3qAjB5iPk0rVeqT8eLK6NOW9+ZmGxHiSyReCuRVbOiJUn O8c3032PpeKyyZ1i2pceaLxfa6pwPNCFu+//afBU= Message-ID: <810369de-077a-412f-b524-6528317c1506@linux.microsoft.com> Date: Wed, 15 May 2024 09:31:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 5/6] drivers/hv/vmbus: Get the irq number from DeviceTree To: Saurabh Singh Sengar Cc: arnd@arndb.de, bhelgaas@google.com, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, decui@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, kw@linux.com, kys@microsoft.com, lenb@kernel.org, lpieralisi@kernel.org, mingo@redhat.com, mhklinux@outlook.com, rafael@kernel.org, robh@kernel.org, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org, ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev References: <20240514224508.212318-1-romank@linux.microsoft.com> <20240514224508.212318-6-romank@linux.microsoft.com> <20240515094225.GA22844@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Language: en-US From: Roman Kisel In-Reply-To: <20240515094225.GA22844@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240515_093151_406459_AE1D6367 X-CRM114-Status: GOOD ( 19.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 5/15/2024 2:42 AM, Saurabh Singh Sengar wrote: > On Tue, May 14, 2024 at 03:43:52PM -0700, Roman Kisel wrote: >> The vmbus driver uses ACPI for interrupt assignment on > > In subject use the prefix "Drivers: hv: vmbus:". > It is preferred to us "VMbus/VMBus" instead of "vmbus" for all the > commit message and comments. > I can see "Drivers: hv: vmbus:" as a convention from the data[1], will update the commit message per that. The recent Michael Kelly's patchset where the Hyper-V documentation is updated to use "VMBus" instead of the incorrect one (iiuc) "VMbus" compels me to use "VMBus" out of the options you have enumerated, in the commit description. [1] The data mining device was git log --all --grep='Drivers: hv: vmbus:' and variations thereof. >> arm64 hence it won't function in the VTL mode where only >> DeviceTree can be used. >> >> Update the vmbus driver to discover interrupt configuration >> via DeviceTree. >> >> Signed-off-by: Roman Kisel >> --- >> drivers/hv/vmbus_drv.c | 37 +++++++++++++++++++++++++++++++++++++ >> 1 file changed, 37 insertions(+) >> >> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c >> index e25223cee3ab..52f01bd1c947 100644 >> --- a/drivers/hv/vmbus_drv.c >> +++ b/drivers/hv/vmbus_drv.c >> @@ -36,6 +36,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include "hyperv_vmbus.h" >> @@ -2316,6 +2317,34 @@ static int vmbus_acpi_add(struct platform_device *pdev) >> } >> #endif >> >> +static int __maybe_unused vmbus_of_set_irq(struct device_node *np) >> +{ >> + struct irq_desc *desc; >> + int irq; >> + >> + irq = of_irq_get(np, 0); >> + if (irq == 0) { >> + pr_err("VMBus interrupt mapping failure\n"); >> + return -EINVAL; >> + } >> + if (irq < 0) { >> + pr_err("VMBus interrupt data can't be read from DeviceTree, error %d\n", irq); >> + return irq; >> + } >> + >> + desc = irq_to_desc(irq); >> + if (!desc) { >> + pr_err("VMBus interrupt description can't be found for virq %d\n", irq); >> + return -ENODEV; >> + } >> + >> + vmbus_irq = irq; >> + vmbus_interrupt = desc->irq_data.hwirq; >> + pr_debug("VMBus virq %d, hwirq %d\n", vmbus_irq, vmbus_interrupt); >> + >> + return 0; >> +} >> + >> static int vmbus_device_add(struct platform_device *pdev) >> { >> struct resource **cur_res = &hyperv_mmio; >> @@ -2324,12 +2353,20 @@ static int vmbus_device_add(struct platform_device *pdev) >> struct device_node *np = pdev->dev.of_node; >> int ret; >> >> + pr_debug("VMBus is present in DeviceTree\n"); >> + >> hv_dev = &pdev->dev; >> >> ret = of_range_parser_init(&parser, np); >> if (ret) >> return ret; >> >> +#ifndef HYPERVISOR_CALLBACK_VECTOR >> + ret = vmbus_of_set_irq(np); >> + if (ret) >> + return ret; >> +#endif >> + >> for_each_of_range(&parser, &range) { >> struct resource *res; >> >> -- >> 2.45.0 >> -- Thank you, Roman _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel