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 A5FF5C19F2B for ; Thu, 4 Aug 2022 10:39:47 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8/1Zx+3s2aajX6eF71EY8UQli+ORZ35ih3wB78utjl8=; b=MDRQaBPG1HDt6n wgCIa+45Bf+qviAi+LItCR2BQiSZbez0vqpU8OuAofkhoFvnGGck1I4M60YidQX4gvyRFjV3AdNWa 2FMQwvfI4hFhdxdzEUtI0ffX/Ij4a+8Nn+G+qiBOQvDUE3JPqzmzEZ89B71XcBHfi2naQJUTR4X2Y wSsNk9Cjf8OOZ1dPnKs0OuCKArXfi89N25pi2eOgZ8fGwfxQc68DxviXORwt7GpEvIAiEPXdURJlK +BGGq3UWgLQpBH/Ar4qjv/vTA7eVrqdSjo4qUVOz9HN+PDkFNx4L3RmAi1/fNhx3Ja6QVAN0oY+Cr 7VYC0vSNZaxsdVMn6GUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJYFd-005GpA-2p; Thu, 04 Aug 2022 10:38:49 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJYFZ-005Gnb-HU for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2022 10:38:47 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E5245615C0; Thu, 4 Aug 2022 10:38:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 406BEC433D6; Thu, 4 Aug 2022 10:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659609524; bh=Z/85y7bcpy3w9XH2okQGl19Ip19U9oinyV0i9Vy+EsQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZeviLZ5UGARUUMPpBJMScyf5JV6uv4AGj0zHoa0TGfENxtnVF0o3/gvKcVr0ovBsr zXqzYrQUSoSnJwZDIs85qthK11rFoc/yG4gdKIskxk07avEXJaI/LuBJTkyeO5MvXl ZPY2dwaS86jZsghEDc954CaHJg813gikiXCn5A+cS0xPZC3W/HBVX5c6s4XaXSKX2P 9EtuNFiwTTsAupm0KV0CNAfLQQ4J0xfX8OgKXMWmOGXUIT4ZVm2ZufWqs7Mvnwa16Q PjGX8V/yojpjY91kKN7pfTKoYa+h9b9FkQPr9KJQF9JOZhsiSHqkdzso+3g4eGmd+O xxj0r/NDLcCAA== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oJYFV-000vny-Vt; Thu, 04 Aug 2022 11:38:42 +0100 Date: Thu, 04 Aug 2022 11:38:41 +0100 Message-ID: <87mtckwaxa.wl-maz@kernel.org> From: Marc Zyngier To: "Gupta, Nipun" Cc: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "gregkh@linuxfoundation.org" , "rafael@kernel.org" , "tglx@linutronix.de" , "okaya@kernel.org" , "Anand, Harpreet" , "Simek,\ Michal" , "Agarwal, Nikhil" Subject: Re: [RFC PATCH 1/2] irqchip: cdx-bus: add cdx-MSI domain with gic-its domain as parent In-Reply-To: References: <20220803122655.100254-1-nipun.gupta@amd.com> <20220803122655.100254-2-nipun.gupta@amd.com> <87pmhgwfyp.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: Nipun.Gupta@amd.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, rafael@kernel.org, tglx@linutronix.de, okaya@kernel.org, harpreet.anand@amd.com, michal.simek@amd.com, nikhil.agarwal@amd.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220804_033845_704643_D5EDD826 X-CRM114-Status: GOOD ( 33.40 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 04 Aug 2022 10:18:19 +0100, "Gupta, Nipun" wrote: > > > +static const struct of_device_id cdx_device_id[] = { > > > + {.compatible = "xlnx,cdx-controller-1.0", }, > > > > What is this? If this is supposed to represent am ITS, it really > > should say so. > > This is a CDX bus controller, not an ITS. This will be added as a part of > device-tree documentation when we add formal CDX bus patches. > CDX is an upcoming AMD bus, supporting dynamically discovered > FPGA devices. Right. So that's yet another reason to not have this glue code at all. > > > > > > + {}, > > > +}; > > > + > > > +struct irq_domain *get_parent(struct fwnode_handle *handle) > > > +{ > > > + return irq_find_matching_fwnode(handle, DOMAIN_BUS_NEXUS); > > > +} > > > + > > > +static void __init its_cdx_msi_init_one(struct device_node *np, > > > + const char *name) > > > +{ > > > + struct irq_domain *parent; > > > + struct irq_domain *cdx_msi_domain; > > > + struct fwnode_handle *fwnode_handle; > > > + struct device_node *parent_node; > > > + > > > + parent_node = of_parse_phandle(np, "msi-parent", 0); > > > + > > > + parent = get_parent(of_node_to_fwnode(parent_node)); > > > + if (!parent || !msi_get_domain_info(parent)) { > > > + pr_err("%s: unable to locate ITS domain\n", name); > > > + return; > > > + } > > > + > > > + fwnode_handle = of_node_to_fwnode(np); > > > + cdx_msi_domain = platform_msi_create_irq_domain(fwnode_handle, > > > + &its_cdx_msi_domain_info, > > > + parent); > > > + if (!cdx_msi_domain) { > > > + pr_err("%s: unable to create cdx bus domain\n", name); > > > + return; > > > + } > > > + > > > + pr_info("cdx bus MSI: %s domain created\n", name); > > > +} > > > + > > > +static void __init its_cdx_of_msi_init(void) > > > +{ > > > + struct device_node *np; > > > + > > > + for (np = of_find_matching_node(NULL, cdx_device_id); np; > > > + np = of_find_matching_node(np, cdx_device_id)) { > > > + if (!of_device_is_available(np)) > > > + continue; > > > + > > > + its_cdx_msi_init_one(np, np->full_name); > > > + } > > > +} > > > + > > > +static int __init its_cdx_msi_init(void) > > > +{ > > > + its_cdx_of_msi_init(); > > > + > > > + return 0; > > > +} > > > + > > > +early_initcall(its_cdx_msi_init); > > > > I really don't think we should have any more of this muck. Yes, the > > other busses are also doing that, but here's our chance to do > > something better. > > > > Why can't the *bus* driver (I assume there is one) perform these > > tasks? It would really help if this patch was shown in context, > > because I have no idea how this fits in the grand scheme of things. > > Agree, bus driver could do this stuff, and I was considering it too, > but as this was the norm so added these changes in this IRQ chip :). Well, let's not miss this opportunity to improve things! :-) > Bus driver is not out yet, and we have pushed these as RFC changes > for early feedback (mentioned in the cover letter), but yes, these > patches would be clubbed as a part of overall changes. > > And we can move it as a part of bus driver itself. I hope that suits? It certainly sounds better than the above looks! Please Cc me on the submission of this infrastructure. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel