Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8499124rwr; Thu, 11 May 2023 02:02:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49NxLpN8mfC9xs0qiVCKurqVzkyMh9RtvejMYG37KQ9SEvae9jgH8wMVOFgmmW/rcNFAhr X-Received: by 2002:a05:6a00:807:b0:647:b071:20c4 with SMTP id m7-20020a056a00080700b00647b07120c4mr9993356pfk.1.1683795724960; Thu, 11 May 2023 02:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683795724; cv=none; d=google.com; s=arc-20160816; b=m0NvvA+oVODelqZjM8BMRjQMwLLzEMdRxWdHy2xlIktKT8Sfi22pjJLawvpqm9pikd uyKO1qirN9KHKierTP5T0qtuG/U4rATb+lsrvfREF/PeEQ4PbsoIIigXRqKGCvX4LYnJ RgvF33rq4J4rKWqtL+NWxTWYRK2vBwmXMqdWSRvDYaRRyUzIS5NefldNb8bot0ykArsA d5mICKp6qFS9qckIVG1HwA4yhJEu2JDGUlBBrNU9wctxsFkt7fC63gvjkx7fSLVP56Wo n8zIInGpd0UIThdo5tEUsEJz/x6HeyvcPcARJbOmGaRs4zgMX5iU86T0DG7bvE4x5bqR wG9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=j8hZh5QBo9J6J9IrzVtyOQaUxwXlXKWm2hB1rmIE5sI=; b=BWqGx4+cGayllr6mfsIbXHSQy6mhI3pFVbZ9C5IVtJeBk88dgIMfXsYWhTX9wIolHp F/sL+BxyuMl9AuAvnqs1MgnS/EEHly0/Sq4BXMreUwLTjKv4S5L2UUnSTa80SWFR50Am eP8kaSzzu7oGDziUkQfeO11yczNVgWTL+TzVxX7dZsBzL+7nA0snVDKP6PHuoQfERvIe HXI4piqvWZxX4lZiLOMwJ6xE9dc+rTDfr8c3cKfpcjUfI3hqKT5lFMSByO6XX0Oqhc1Y yTSZfzXUpyW8AfS7j2byjWumYkviDBDgHfPhf18AGJhuPwv7cHZCh8ZXpEDQ6Uh1DeNW OcoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u4n6aw3F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x27-20020a63b21b000000b0050faaed4f76si6242967pge.751.2023.05.11.02.01.50; Thu, 11 May 2023 02:02:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u4n6aw3F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234000AbjEKIrT (ORCPT + 99 others); Thu, 11 May 2023 04:47:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjEKIrR (ORCPT ); Thu, 11 May 2023 04:47:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7046E4EF6 for ; Thu, 11 May 2023 01:47:16 -0700 (PDT) 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 D6A8760E9C for ; Thu, 11 May 2023 08:47:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CC94C433D2; Thu, 11 May 2023 08:47:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683794835; bh=4TLG3y9qYIVVTgqmdcT1+wV71ze9TJdgas6viAVD10M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=u4n6aw3FC/JOm4h/fZ1KsDQd+jdus7CM8mmBoxtHrGISNz9Gx1HjRCSIuBdetlp1P DQQP0/5stuBoKKDvQIATIwTJx8yk+yQ8NmZO1eQVbSdGvs0qVwge7W5aO7L2xSM+hM ixEL5EuqIKo91B1hrmL/FDtYcAseWeAfYf6GvgnAcOHWfMqI5RjKLUj2bFvfhOzWYa /8MtoqVutVCu/sMykm6ohPJbro69UQc8FWkm32+GuwZy5mVnOsVddZxIvKi2GENE3C R6fAcN9Cw5pc+CgYzQaL+45RttzL2L1o3P+cthW9v8etM8JL41WTNDnJ88SuECJ7Nh L0ILgpi4UjYpQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.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 1px1xA-00EHXq-R1; Thu, 11 May 2023 09:47:12 +0100 Date: Thu, 11 May 2023 09:47:12 +0100 Message-ID: <86zg6bmezz.wl-maz@kernel.org> From: Marc Zyngier To: John Paul Adrian Glaubitz Cc: Thomas Gleixner , Rich Felker , linux-kernel@vger.kernel.org Subject: Re: [PATCH] irqchip/jcore-aic: Fix missing allocation of IRQ descriptors In-Reply-To: <3c76bea5e45a5ae9ea58b3ff87f9971955a3a021.camel@physik.fu-berlin.de> References: <20230510163343.43090-1-glaubitz@physik.fu-berlin.de> <479a18513b9d8c6e8ccb96093a0f0dd7@kernel.org> <3c76bea5e45a5ae9ea58b3ff87f9971955a3a021.camel@physik.fu-berlin.de> 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/28.2 (aarch64-unknown-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.219.108.64 X-SA-Exim-Rcpt-To: glaubitz@physik.fu-berlin.de, tglx@linutronix.de, dalias@libc.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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 May 2023 08:22:20 +0100, John Paul Adrian Glaubitz wrote: > > Hi Jason! ??? > > On Thu, 2023-05-11 at 07:56 +0100, Marc Zyngier wrote: > > On 2023-05-10 17:33, John Paul Adrian Glaubitz wrote: > > > The initialization function for the J-Core AIC aic_irq_of_init() is > > > currently missing the call to irq_alloc_descs() which allocates and > > > initializes all the IRQ descriptors. Add missing function call and > > > return the error code from irq_alloc_descs() in case the allocation > > > fails. > > > > > > Fixes: 981b58f66cfc ("irqchip/jcore-aic: Add J-Core AIC driver") > > > Signed-off-by: John Paul Adrian Glaubitz > > > --- > > > drivers/irqchip/irq-jcore-aic.c | 7 +++++++ > > > 1 file changed, 7 insertions(+) > > > > > > diff --git a/drivers/irqchip/irq-jcore-aic.c > > > b/drivers/irqchip/irq-jcore-aic.c > > > index 5f47d8ee4ae3..b9dcc8e78c75 100644 > > > --- a/drivers/irqchip/irq-jcore-aic.c > > > +++ b/drivers/irqchip/irq-jcore-aic.c > > > @@ -68,6 +68,7 @@ static int __init aic_irq_of_init(struct device_node > > > *node, > > > unsigned min_irq = JCORE_AIC2_MIN_HWIRQ; > > > unsigned dom_sz = JCORE_AIC_MAX_HWIRQ+1; > > > struct irq_domain *domain; > > > + int ret; > > > > > > pr_info("Initializing J-Core AIC\n"); > > > > > > @@ -100,6 +101,12 @@ static int __init aic_irq_of_init(struct > > > device_node *node, > > > jcore_aic.irq_unmask = noop; > > > jcore_aic.name = "AIC"; > > > > > > + ret = irq_alloc_descs(-1, min_irq, dom_sz - min_irq, > > > + of_node_to_nid(node)); > > > + > > > + if (ret < 0) > > > + return ret; > > > + > > > domain = irq_domain_add_legacy(node, dom_sz - min_irq, min_irq, > > > min_irq, > > > &jcore_aic_irqdomain_ops, > > > &jcore_aic); > > > > [- Jason] > > > > It really begs the question: how has it ever been working before? > > Users already used a locally patched kernel to work around this problem. You're not answering my question. Does it mean JCore never worked upstream? > > Is there any plan to modernise the port and get it to allocate > > irq_descs on demand, as we do on most architectures? > > Yes, there are plans to modernize the port. We're first working on > upstreaming all kinds of patches that have been queuing up over the > time. I'd rather you skip that step and focus on making it work as a modern architecture. This really looks like ARM circa 2007... :-/ M. -- Without deviation from the norm, progress is not possible.