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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FB13C4708E for ; Wed, 7 Dec 2022 08:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229738AbiLGIJp (ORCPT ); Wed, 7 Dec 2022 03:09:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiLGIJl (ORCPT ); Wed, 7 Dec 2022 03:09:41 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F4C420194; Wed, 7 Dec 2022 00:09:41 -0800 (PST) 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 A0F6D60B88; Wed, 7 Dec 2022 08:09:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F06B2C43470; Wed, 7 Dec 2022 08:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670400580; bh=s3Ks7gxz549Tw6ghF7iHZgKhg542lt4gBSuimocGubc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YU261TpGQS9I9z4RSsQt6DxPD0G01icn8CS1QzAzP2ul8hKtV2OFQ+A0nmLj9IU3x Og+zG0axoa0c9+sMq8IQ6nZQVe0lHj0007RMMvZGwpwuVondb3lY6S5MpKmuq7NHpf qKlbPBZ8BBeF7862ZVMmbKIQlz8vchyn/DITxD/0k7bcEqCYHpIvZg9liYbTb/tuDZ 3uG/awaXbTFzok6MV5AS9Z8YOS0Sv67ZwOCY857e5AnQc4ZON+7PjJnMP49tN371Qw KxcoVkKZjKQLkGSKeoUJm5QK6KYkRLufmYRNaFL/87ic8dFNKsovkobKYB6Ni9Qa23 UZXRGeCIpFO9w== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.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 1p2pUn-00B1yo-Fu; Wed, 07 Dec 2022 08:09:37 +0000 Date: Wed, 07 Dec 2022 08:08:04 +0000 Message-ID: <874ju7tz4r.wl-maz@kernel.org> From: Marc Zyngier To: Yinbo Zhu Cc: Huacai Chen , Jiaxun Yang , Thomas Gleixner , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] irqchip: loongson-liointc: add hierarchy irq support In-Reply-To: <20221207014555.22465-1-zhuyinbo@loongson.cn> References: <20221207014555.22465-1-zhuyinbo@loongson.cn> 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") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: zhuyinbo@loongson.cn, chenhuacai@kernel.org, jiaxun.yang@flygoat.com, tglx@linutronix.de, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 07 Dec 2022 01:45:55 +0000, Yinbo Zhu wrote: > > When the irq of hierarchical interrupt chip was routed to liointc > that asked liointc driver to support hierarchy irq and this patch > was to add such support. > > In addition, this patch only consider dts, and acpi hierarchy irq > support will be added later as required. > > Signed-off-by: Yinbo Zhu > --- > drivers/irqchip/irq-loongson-liointc.c | 31 ++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c > index 0da8716f8f24..58e43a2cd02e 100644 > --- a/drivers/irqchip/irq-loongson-liointc.c > +++ b/drivers/irqchip/irq-loongson-liointc.c > @@ -177,6 +177,32 @@ static const struct irq_domain_ops acpi_irq_gc_ops = { > .xlate = liointc_domain_xlate, > }; > > +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY > +static int liointc_domain_alloc(struct irq_domain *domain, unsigned int virq, > + unsigned int nr_irqs, void *arg) > +{ > + int i, ret; > + irq_hw_number_t hwirq; > + unsigned int type = IRQ_TYPE_NONE; > + struct irq_fwspec *fwspec = arg; > + > + ret = irq_domain_translate_twocell(domain, fwspec, &hwirq, &type); > + if (ret) > + return ret; > + > + for (i = 0; i < nr_irqs; i++) > + irq_map_generic_chip(domain, virq + i, hwirq + i); > + > + return 0; > +} > + > +static const struct irq_domain_ops of_irq_gc_ops = { > + .translate = irq_domain_translate_twocell, > + .alloc = liointc_domain_alloc, > + .free = irq_domain_free_irqs_top, > +}; > +#endif > + > static int liointc_init(phys_addr_t addr, unsigned long size, int revision, > struct fwnode_handle *domain_handle, struct device_node *node) > { > @@ -218,8 +244,13 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision, > domain = irq_domain_create_linear(domain_handle, LIOINTC_CHIP_IRQ, > &acpi_irq_gc_ops, priv); > else > +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY > + domain = irq_domain_create_linear(domain_handle, LIOINTC_CHIP_IRQ, > + &of_irq_gc_ops, priv); > +#else > domain = irq_domain_create_linear(domain_handle, LIOINTC_CHIP_IRQ, > &irq_generic_chip_ops, priv); > +#endif Two things: - Why do we need three calls to create the same domains depending on what firmware is used and kernel configuration? - who is going to decide whether to select the CONFIG_IRQ_DOMAIN_HIERARCHY option? I'd really like to see a statement from the Loongson folks about what this whole DT stuff is all about. AFAICT, the core ACPICA stuff isn't even fully merged (i.e. we still rely on arch-specific hacks). Can you *please* finish what you've started before adding another layer of quality stuff on top? M. -- Without deviation from the norm, progress is not possible.