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 CDDC7C7EE22 for ; Thu, 11 May 2023 08:47:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235194AbjEKIrU (ORCPT ); Thu, 11 May 2023 04:47:20 -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 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.