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 X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46847C433E0 for ; Sat, 25 Jul 2020 14:10:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E020206F6 for ; Sat, 25 Jul 2020 14:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595686255; bh=K5mDISNf+19YggF4dg2G2Pd6dD/CEpErQK90WHh7Xo0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=xanNZSNOtQDmEijOvigk4dkgpsAH15bYl5ZDn9qTl+FUNuIp2hsMgAaOrYLbwLKh9 TqeQa5guU7VSp7wlsB/rzEDlTksNKpdVo2npvJB1wGTfFPPBxny6kPFuHVgHp9tzqZ yL8oZ8ZPd6q0EwowC4/BWmxYPrMAHVbWy22pkwYA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726745AbgGYOKy (ORCPT ); Sat, 25 Jul 2020 10:10:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:38796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726652AbgGYOKy (ORCPT ); Sat, 25 Jul 2020 10:10:54 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 09E8C206D7; Sat, 25 Jul 2020 14:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595686253; bh=K5mDISNf+19YggF4dg2G2Pd6dD/CEpErQK90WHh7Xo0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qysRIWEcIuhmGp7FUvaOYD5tjF+UQfqSNJaw75J3f29CSg5jbMYaurMGUatJszyh4 rgfMfkggM0DFh7RTXDGAOtCQCW27alO0amoXURKYSNn2bOXYn4zI+I42eEUoZI5olC EtPFVj6MNMlqYRhJrrq2ifc37JnRDnCieEUVI1BA= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jzKt1-00EqzU-GW; Sat, 25 Jul 2020 15:10:51 +0100 Date: Sat, 25 Jul 2020 15:10:50 +0100 Message-ID: <87zh7nwuqd.wl-maz@kernel.org> From: Marc Zyngier To: Lokesh Vutla Cc: Rob Herring , Thomas Gleixner , Nishanth Menon , Tero Kristo , Santosh Shilimkar , Linux ARM Mailing List , Sekhar Nori , Grygorii Strashko , Peter Ujfalusi , Device Tree Mailing List , Suman Anna Subject: Re: [PATCH v3 9/9] irqchip/ti-sci-inta: Add support for INTA directly connecting to GIC In-Reply-To: <20200724141837.4542-10-lokeshvutla@ti.com> References: <20200724141837.4542-1-lokeshvutla@ti.com> <20200724141837.4542-10-lokeshvutla@ti.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (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: 62.31.163.78 X-SA-Exim-Rcpt-To: lokeshvutla@ti.com, robh+dt@kernel.org, tglx@linutronix.de, nm@ti.com, t-kristo@ti.com, ssantosh@kernel.org, linux-arm-kernel@lists.infradead.org, nsekhar@ti.com, grygorii.strashko@ti.com, peter.ujfalusi@ti.com, devicetree@vger.kernel.org, s-anna@ti.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Fri, 24 Jul 2020 15:18:37 +0100, Lokesh Vutla wrote: > > Driver assumes that Interrupt parent to Interrupt Aggregator is always > Interrupt router. This is not true always and GIC can be a parent to > Interrupt Aggregator. Update the driver to detect the parent and request > the parent irqs accordingly. > > Signed-off-by: Lokesh Vutla > --- > drivers/irqchip/irq-ti-sci-inta.c | 90 ++++++++++++++++++++++++++----- > 1 file changed, 77 insertions(+), 13 deletions(-) > > diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c > index 7e3ebf6ed2cd..00c17ade118a 100644 > --- a/drivers/irqchip/irq-ti-sci-inta.c > +++ b/drivers/irqchip/irq-ti-sci-inta.c > @@ -8,6 +8,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -128,6 +129,37 @@ static void ti_sci_inta_irq_handler(struct irq_desc *desc) > chained_irq_exit(irq_desc_get_chip(desc), desc); > } > > +/** > + * ti_sci_inta_xlate_irq() - Translate hwirq to parent's hwirq. > + * @inta: IRQ domain corresponding to Interrupt Aggregator > + * @irq: Hardware irq corresponding to the above irq domain > + * > + * Return parent irq number if translation is available else -ENOENT. > + */ > +static int ti_sci_inta_xlate_irq(struct ti_sci_inta_irq_domain *inta, > + u16 vint_id) > +{ > + struct device_node *np = dev_of_node(&inta->pdev->dev); > + u32 base, parent_base, size; > + const __be32 *range; > + int len; > + > + range = of_get_property(np, "ti,interrupt-ranges", &len); > + if (!range) > + return vint_id; > + > + for (len /= sizeof(*range); len >= 3; len -= 3) { > + base = be32_to_cpu(*range++); > + parent_base = be32_to_cpu(*range++); > + size = be32_to_cpu(*range++); > + > + if (base <= vint_id && vint_id < base + size) > + return vint_id - base + parent_base; > + } > + > + return -ENOENT; > +} > + > /** > * ti_sci_inta_alloc_parent_irq() - Allocate parent irq to Interrupt aggregator > * @domain: IRQ domain corresponding to Interrupt Aggregator > @@ -139,30 +171,55 @@ static struct ti_sci_inta_vint_desc *ti_sci_inta_alloc_parent_irq(struct irq_dom > struct ti_sci_inta_irq_domain *inta = domain->host_data; > struct ti_sci_inta_vint_desc *vint_desc; > struct irq_fwspec parent_fwspec; > + struct device_node *parent_node; > unsigned int parent_virq; > - u16 vint_id; > + u16 vint_id, p_hwirq; > + int ret; > > vint_id = ti_sci_get_free_resource(inta->vint); > if (vint_id == TI_SCI_RESOURCE_NULL) > return ERR_PTR(-EINVAL); > > + p_hwirq = ti_sci_inta_xlate_irq(inta, vint_id); > + if (p_hwirq < 0) { > + ret = p_hwirq; > + goto free_vint; > + } > + > vint_desc = kzalloc(sizeof(*vint_desc), GFP_KERNEL); > - if (!vint_desc) > - return ERR_PTR(-ENOMEM); > + if (!vint_desc) { > + ret = -ENOMEM; > + goto free_vint; > + } > > vint_desc->domain = domain; > vint_desc->vint_id = vint_id; > INIT_LIST_HEAD(&vint_desc->list); > > - parent_fwspec.fwnode = of_node_to_fwnode(of_irq_find_parent(dev_of_node(&inta->pdev->dev))); > - parent_fwspec.param_count = 2; > - parent_fwspec.param[0] = inta->pdev->id; > - parent_fwspec.param[1] = vint_desc->vint_id; > + parent_node = of_irq_find_parent(dev_of_node(&inta->pdev->dev)); > + parent_fwspec.fwnode = of_node_to_fwnode(parent_node); > + if (of_property_read_u32(parent_node, "#interrupt-cells", > + &parent_fwspec.param_count)) { > + ret = -EINVAL; > + goto free_vint_desc; > + } > + > + if (of_device_is_compatible(parent_node, "arm,gic-v3")) { > + /* Parent is GIC */ > + parent_fwspec.param[0] = 0; > + parent_fwspec.param[1] = p_hwirq - 32; > + parent_fwspec.param[2] = IRQ_TYPE_LEVEL_HIGH; Same comment as on patch #6. > + } else { > + /* Parent is Interrupt Router */ > + parent_fwspec.param[0] = p_hwirq; > + } > > parent_virq = irq_create_fwspec_mapping(&parent_fwspec); > if (parent_virq == 0) { > - kfree(vint_desc); > - return ERR_PTR(-EINVAL); > + dev_err(&inta->pdev->dev, "Parent IRQ allocation failed\n"); > + ret = -EINVAL; > + goto free_vint_desc; > + > } > vint_desc->parent_virq = parent_virq; > > @@ -171,6 +228,11 @@ static struct ti_sci_inta_vint_desc *ti_sci_inta_alloc_parent_irq(struct irq_dom > ti_sci_inta_irq_handler, vint_desc); > > return vint_desc; > +free_vint_desc: > + kfree(vint_desc); > +free_vint: > + ti_sci_release_resource(inta->vint, vint_id); > + return ERR_PTR(ret); > } > > /** > @@ -555,15 +617,15 @@ static int ti_sci_inta_irq_domain_probe(struct platform_device *pdev) > return -EINVAL; > } > > - inta->vint = devm_ti_sci_get_of_resource(inta->sci, dev, pdev->id, > - "ti,sci-rm-range-vint"); > + inta->vint = devm_ti_sci_get_resource(inta->sci, dev, pdev->id, > + TI_SCI_RESASG_SUBTYPE_IA_VINT); Same comment as on patch #6 as well, although the pdev->id hijacking already existed. I believe this should be fixed, unless you can explain why this can't possibly be implemented in a different way. > if (IS_ERR(inta->vint)) { > dev_err(dev, "VINT resource allocation failed\n"); > return PTR_ERR(inta->vint); > } > > - inta->global_event = devm_ti_sci_get_of_resource(inta->sci, dev, pdev->id, > - "ti,sci-rm-range-global-event"); > + inta->global_event = devm_ti_sci_get_resource(inta->sci, dev, pdev->id, > + TI_SCI_RESASG_SUBTYPE_GLOBAL_EVENT_SEVT); > if (IS_ERR(inta->global_event)) { > dev_err(dev, "Global event resource allocation failed\n"); > return PTR_ERR(inta->global_event); > @@ -594,6 +656,8 @@ static int ti_sci_inta_irq_domain_probe(struct platform_device *pdev) > INIT_LIST_HEAD(&inta->vint_list); > mutex_init(&inta->vint_mutex); > > + dev_info(dev, "Interrupt Aggregator domain %d created\n", pdev->id); > + > return 0; > } > > -- > 2.27.0 > > Thanks, M. -- Without deviation from the norm, progress is not possible. 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 X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8947C433DF for ; Sat, 25 Jul 2020 14:12:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 817B6206D7 for ; Sat, 25 Jul 2020 14:12:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SMSQtqbA"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="qysRIWEc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 817B6206D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject: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=ooSiYdaFuvFnwW17O0ei79JnjMC3/qxnOBSEfqNAQqA=; b=SMSQtqbAy7TSC5sAl9NM09ge2 7d6u6unuq9KUG4VSLSdM33kkg13jfttl2Uwvt8tkpn2SeM9wiiqglLOLFpeoig3dkNKzpT/AmpLiD 6O7vLX8Nxmm1ceDdM7Dhd0mFULoQQETstS6hdxHG/OwY7cwi0yuMQAe/LHqJ1ZT79C1xofzILbsrB bOoOO6PpQQL7cGHgPdkKIgwZs//42bhGytKlGSV/080kzzVYBt6+cqKTZ0UG1+W+6nADwe93gaFQk R2hO36wuzAejaz5yzq6LNjyxzT8zpN7jkQwB4vFscJvQO0B+CiYRqwwzy0pxH/+RXLPEiyuRLEF03 Q/ZSuEVLQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jzKtB-00055r-2B; Sat, 25 Jul 2020 14:11:01 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jzKt7-00054M-QN for linux-arm-kernel@lists.infradead.org; Sat, 25 Jul 2020 14:10:58 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 09E8C206D7; Sat, 25 Jul 2020 14:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595686253; bh=K5mDISNf+19YggF4dg2G2Pd6dD/CEpErQK90WHh7Xo0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qysRIWEcIuhmGp7FUvaOYD5tjF+UQfqSNJaw75J3f29CSg5jbMYaurMGUatJszyh4 rgfMfkggM0DFh7RTXDGAOtCQCW27alO0amoXURKYSNn2bOXYn4zI+I42eEUoZI5olC EtPFVj6MNMlqYRhJrrq2ifc37JnRDnCieEUVI1BA= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jzKt1-00EqzU-GW; Sat, 25 Jul 2020 15:10:51 +0100 Date: Sat, 25 Jul 2020 15:10:50 +0100 Message-ID: <87zh7nwuqd.wl-maz@kernel.org> From: Marc Zyngier To: Lokesh Vutla Subject: Re: [PATCH v3 9/9] irqchip/ti-sci-inta: Add support for INTA directly connecting to GIC In-Reply-To: <20200724141837.4542-10-lokeshvutla@ti.com> References: <20200724141837.4542-1-lokeshvutla@ti.com> <20200724141837.4542-10-lokeshvutla@ti.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (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: 62.31.163.78 X-SA-Exim-Rcpt-To: lokeshvutla@ti.com, robh+dt@kernel.org, tglx@linutronix.de, nm@ti.com, t-kristo@ti.com, ssantosh@kernel.org, linux-arm-kernel@lists.infradead.org, nsekhar@ti.com, grygorii.strashko@ti.com, peter.ujfalusi@ti.com, devicetree@vger.kernel.org, s-anna@ti.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-20200725_101058_013369_7424204F X-CRM114-Status: GOOD ( 30.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , Peter Ujfalusi , Grygorii Strashko , Device Tree Mailing List , Sekhar Nori , Tero Kristo , Rob Herring , Santosh Shilimkar , Thomas Gleixner , Linux ARM Mailing List 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 Fri, 24 Jul 2020 15:18:37 +0100, Lokesh Vutla wrote: > > Driver assumes that Interrupt parent to Interrupt Aggregator is always > Interrupt router. This is not true always and GIC can be a parent to > Interrupt Aggregator. Update the driver to detect the parent and request > the parent irqs accordingly. > > Signed-off-by: Lokesh Vutla > --- > drivers/irqchip/irq-ti-sci-inta.c | 90 ++++++++++++++++++++++++++----- > 1 file changed, 77 insertions(+), 13 deletions(-) > > diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c > index 7e3ebf6ed2cd..00c17ade118a 100644 > --- a/drivers/irqchip/irq-ti-sci-inta.c > +++ b/drivers/irqchip/irq-ti-sci-inta.c > @@ -8,6 +8,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -128,6 +129,37 @@ static void ti_sci_inta_irq_handler(struct irq_desc *desc) > chained_irq_exit(irq_desc_get_chip(desc), desc); > } > > +/** > + * ti_sci_inta_xlate_irq() - Translate hwirq to parent's hwirq. > + * @inta: IRQ domain corresponding to Interrupt Aggregator > + * @irq: Hardware irq corresponding to the above irq domain > + * > + * Return parent irq number if translation is available else -ENOENT. > + */ > +static int ti_sci_inta_xlate_irq(struct ti_sci_inta_irq_domain *inta, > + u16 vint_id) > +{ > + struct device_node *np = dev_of_node(&inta->pdev->dev); > + u32 base, parent_base, size; > + const __be32 *range; > + int len; > + > + range = of_get_property(np, "ti,interrupt-ranges", &len); > + if (!range) > + return vint_id; > + > + for (len /= sizeof(*range); len >= 3; len -= 3) { > + base = be32_to_cpu(*range++); > + parent_base = be32_to_cpu(*range++); > + size = be32_to_cpu(*range++); > + > + if (base <= vint_id && vint_id < base + size) > + return vint_id - base + parent_base; > + } > + > + return -ENOENT; > +} > + > /** > * ti_sci_inta_alloc_parent_irq() - Allocate parent irq to Interrupt aggregator > * @domain: IRQ domain corresponding to Interrupt Aggregator > @@ -139,30 +171,55 @@ static struct ti_sci_inta_vint_desc *ti_sci_inta_alloc_parent_irq(struct irq_dom > struct ti_sci_inta_irq_domain *inta = domain->host_data; > struct ti_sci_inta_vint_desc *vint_desc; > struct irq_fwspec parent_fwspec; > + struct device_node *parent_node; > unsigned int parent_virq; > - u16 vint_id; > + u16 vint_id, p_hwirq; > + int ret; > > vint_id = ti_sci_get_free_resource(inta->vint); > if (vint_id == TI_SCI_RESOURCE_NULL) > return ERR_PTR(-EINVAL); > > + p_hwirq = ti_sci_inta_xlate_irq(inta, vint_id); > + if (p_hwirq < 0) { > + ret = p_hwirq; > + goto free_vint; > + } > + > vint_desc = kzalloc(sizeof(*vint_desc), GFP_KERNEL); > - if (!vint_desc) > - return ERR_PTR(-ENOMEM); > + if (!vint_desc) { > + ret = -ENOMEM; > + goto free_vint; > + } > > vint_desc->domain = domain; > vint_desc->vint_id = vint_id; > INIT_LIST_HEAD(&vint_desc->list); > > - parent_fwspec.fwnode = of_node_to_fwnode(of_irq_find_parent(dev_of_node(&inta->pdev->dev))); > - parent_fwspec.param_count = 2; > - parent_fwspec.param[0] = inta->pdev->id; > - parent_fwspec.param[1] = vint_desc->vint_id; > + parent_node = of_irq_find_parent(dev_of_node(&inta->pdev->dev)); > + parent_fwspec.fwnode = of_node_to_fwnode(parent_node); > + if (of_property_read_u32(parent_node, "#interrupt-cells", > + &parent_fwspec.param_count)) { > + ret = -EINVAL; > + goto free_vint_desc; > + } > + > + if (of_device_is_compatible(parent_node, "arm,gic-v3")) { > + /* Parent is GIC */ > + parent_fwspec.param[0] = 0; > + parent_fwspec.param[1] = p_hwirq - 32; > + parent_fwspec.param[2] = IRQ_TYPE_LEVEL_HIGH; Same comment as on patch #6. > + } else { > + /* Parent is Interrupt Router */ > + parent_fwspec.param[0] = p_hwirq; > + } > > parent_virq = irq_create_fwspec_mapping(&parent_fwspec); > if (parent_virq == 0) { > - kfree(vint_desc); > - return ERR_PTR(-EINVAL); > + dev_err(&inta->pdev->dev, "Parent IRQ allocation failed\n"); > + ret = -EINVAL; > + goto free_vint_desc; > + > } > vint_desc->parent_virq = parent_virq; > > @@ -171,6 +228,11 @@ static struct ti_sci_inta_vint_desc *ti_sci_inta_alloc_parent_irq(struct irq_dom > ti_sci_inta_irq_handler, vint_desc); > > return vint_desc; > +free_vint_desc: > + kfree(vint_desc); > +free_vint: > + ti_sci_release_resource(inta->vint, vint_id); > + return ERR_PTR(ret); > } > > /** > @@ -555,15 +617,15 @@ static int ti_sci_inta_irq_domain_probe(struct platform_device *pdev) > return -EINVAL; > } > > - inta->vint = devm_ti_sci_get_of_resource(inta->sci, dev, pdev->id, > - "ti,sci-rm-range-vint"); > + inta->vint = devm_ti_sci_get_resource(inta->sci, dev, pdev->id, > + TI_SCI_RESASG_SUBTYPE_IA_VINT); Same comment as on patch #6 as well, although the pdev->id hijacking already existed. I believe this should be fixed, unless you can explain why this can't possibly be implemented in a different way. > if (IS_ERR(inta->vint)) { > dev_err(dev, "VINT resource allocation failed\n"); > return PTR_ERR(inta->vint); > } > > - inta->global_event = devm_ti_sci_get_of_resource(inta->sci, dev, pdev->id, > - "ti,sci-rm-range-global-event"); > + inta->global_event = devm_ti_sci_get_resource(inta->sci, dev, pdev->id, > + TI_SCI_RESASG_SUBTYPE_GLOBAL_EVENT_SEVT); > if (IS_ERR(inta->global_event)) { > dev_err(dev, "Global event resource allocation failed\n"); > return PTR_ERR(inta->global_event); > @@ -594,6 +656,8 @@ static int ti_sci_inta_irq_domain_probe(struct platform_device *pdev) > INIT_LIST_HEAD(&inta->vint_list); > mutex_init(&inta->vint_mutex); > > + dev_info(dev, "Interrupt Aggregator domain %d created\n", pdev->id); > + > return 0; > } > > -- > 2.27.0 > > 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