Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3198688lqo; Wed, 15 May 2024 02:42:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1BiWDDgVm9CADpFkSE2wHjvKmk32zyuQGCTjcYpZTmqJvFPIrVVvv1+taJ/zU/k4PR7qSgyrd0XHKavd6aCmoNeTqdUD07cnPZGm7uA== X-Google-Smtp-Source: AGHT+IEF0tXnGImvz2vvPlamREiauExN3DyvZkC9jkusgHr0t0wQt9KWuTglhMdsESpiA0JifOv4 X-Received: by 2002:a05:620a:244a:b0:790:797d:2c4a with SMTP id af79cd13be357-792c75763e2mr1882595785a.14.1715766157109; Wed, 15 May 2024 02:42:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715766157; cv=pass; d=google.com; s=arc-20160816; b=iDdmZ14xV4+GOFGgmYWRjbYmo1+AcEIFXVZdW7xcZTSepVWmAaMalwBAYLc0/5QGVp dxuQMDyx++9yOjEROuBMz+HKQU9ZwPcPloyBgR3EjODkZA9FwOM1Y4w+PJ5mNPu8ZGXM 6YzhqXsAfKhUOSCGV0u++Ks4xxqDomyBQKKLgrRY77gW6RWbIlK5He/CuojPVxVvzGq0 ji0/wSheTy6ZefOhjHJOOBov1ixflmXvBtzu7/fzxZkdzjMCLerRSGV4fSq0JdLz1mtg v/Kdw5XnNi+AFG6lHnPqbZUSwMZ2godBDUl8PpXjMsBJH6I63Uq7e824QT7RY4gAuv/8 IUuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature:dkim-filter; bh=NQ7AiDgfRxffpIQXwgdL3C6EzLSXQTS/o7ht91gAqS0=; fh=nItzodgaC7qz4Eaw0dzaNmkWRdpPt+qoiUUmiIHfWAk=; b=lbd0JXLVloNUYZvvszPS7A9wfNJqpw/D5VOGP1MJxxohTV0/uPZGrOkLNzr+D7QLPB kRhKO57bEjABu8dZFVWpqkR2nrYUfrQwv0gz0r16NpwKriu6+lMnuJALoqkwdrnUBchr OHtDSqwF3ZQmKhA+NnjqMdmHf0WU1DoUJVu77j3ruv/SLGXUdY8qa7PdEQnuUaoqAO4Z a+1j6JJc2zrgiuxgG2KEN9VkRB+fR9MqwQLv4ZSJmwb/raaoTwSqnOYoB0p0U3X1VrmT djaQQigCn2pKQR8i/nJnHg9CwabsciH/j123124S0OucMc6/QQrpm6r7WT4XNPgTXt+F F8gQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=mxXRd0hH; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-179715-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf36648csi1315681585a.589.2024.05.15.02.42.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 02:42:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179715-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=mxXRd0hH; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-179715-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D15361C21478 for ; Wed, 15 May 2024 09:42:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BBBB5916B; Wed, 15 May 2024 09:42:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="mxXRd0hH" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D02713B78D; Wed, 15 May 2024 09:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715766147; cv=none; b=j9sPk4I68YvAERAYm4V6PSj+wa1v9pY1EgoXTWhETmreG4bxgsHmV2jjNPG6waObqKl9C9MqsLuibwzQDco8nmYxDjqU33oW+ppjjqcqTOaVN21TfteQcPsrytltWjT5jvsywmy011o1obx2Zmc55duMT4Px26CcP+g0DYq1UO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715766147; c=relaxed/simple; bh=eYFw1/d2wkFMa7JV2SqZUML5FcvjZnP3FCuN6/Gp9Ws=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GTI1YMhGgqmBwQdj6zmiCK2gcgcojzbH4EcGeBXmRtJieOi0+eYJhMrqDp7eyOJ4eRMOu6s9TpbIAwqsDbLF0qI1jngCHjH3l1LvheclTPIJvNCyNt6kghaoy1I9TqnRN8NgEBJIDRAFdPkIbqNj/oQLouRrLntGd+RgBR/cfXA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=mxXRd0hH; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: by linux.microsoft.com (Postfix, from userid 1127) id 309862095D11; Wed, 15 May 2024 02:42:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 309862095D11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715766145; bh=NQ7AiDgfRxffpIQXwgdL3C6EzLSXQTS/o7ht91gAqS0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mxXRd0hH9WpA5F+++DvU+YDLKT/qRzCbB7/CEcBhH6yQR0P+6uyw/m3EE20ZWREzl rCrnuGPmOjKWOitkjESFnkEWZYZnu6iM9fubJvWGBkrBXI0IJadDG+88Y6k+bfaE5g JpFV0R6OlRaSMzgP8PRwSxojROb+/tvnVRd9eriI= Date: Wed, 15 May 2024 02:42:25 -0700 From: Saurabh Singh Sengar To: Roman Kisel 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 Subject: Re: [PATCH v2 5/6] drivers/hv/vmbus: Get the irq number from DeviceTree Message-ID: <20240515094225.GA22844@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20240514224508.212318-1-romank@linux.microsoft.com> <20240514224508.212318-6-romank@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240514224508.212318-6-romank@linux.microsoft.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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. > 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 >