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 523F3CCD187 for ; Fri, 10 Oct 2025 09:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=VuQRe1cc/7+FNCnbhnw1dE+P+rSJ2U05UAEwO7GIQLc=; b=fjBEjBKIG1TJ9OajfO0HA9C84O Od6rqefftt9t192twgQMyYpieU+1uolDU7h6ulu7FsV8TfBRecoO+fz8FicQiUZkVTF1xz6B73685 fdLNy+uOGvFjYPYjXhSjZ/4KwbH42uXFYQBKgU7ERNf3BiasExstiSdqsfnO31hm5BogMXzH6Y03J /P271+R+095x7MPL0oKRIagO0xJbStntwLSCFpjbapalTOjIj7/nFxtRNtKFfjBbGXr+f1/IXXEeq IekDTW8NJXJAXgrBr3RkzHkTq4AfnI0aACtZ1XHB9U0qL3M0WzX1LTD64nv0pyDBlwdY8o6NCQ82i 8NWww39A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v79Qr-000000089r0-1QP1; Fri, 10 Oct 2025 09:29:01 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v79Qp-000000089qs-3O0y for linux-arm-kernel@lists.infradead.org; Fri, 10 Oct 2025 09:28:59 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id D984F62565; Fri, 10 Oct 2025 09:28:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80EF2C4CEF1; Fri, 10 Oct 2025 09:28:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760088538; bh=O/7sfg5UlTpCPHWBq3fIuuXqIzy1Z6yLN/gVrlq+5r0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cVRuDebtQUJBaZ5FXiJhla9PcgDFAm0WLnnYt9+gIJoYcuPfMLJupid2WzCQKAQgO UZ4vnzYVM8pPkohSamwjB0PcctsUumFMjJh8E2nljNQNO/ggnjCpx1vfpdZ4JATQ6U 67MkqBl9R+Yi2pkPyoAUygmWExJ0QDIsvK/EtIsmnFB0sRdMNvEPx3I/VhRcezsFBQ jhIlpaawcZgPH8hzgb4VHJCZmuD9g607VOUwQkM1TzwSL/C+oRMMJOWF+bIiudVh1G O5qom+6NCA8kA3Bl+Zir7CalC0ETRFSSV6TFy1ozBJ0VKSHCdG8bI+bj3RQcJ9gb7d vtnbpt7h5uv4Q== 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.98.2) (envelope-from ) id 1v79Qm-0000000CryE-0DGH; Fri, 10 Oct 2025 09:28:56 +0000 Date: Fri, 10 Oct 2025 10:28:55 +0100 Message-ID: <86jz13xfzc.wl-maz@kernel.org> From: Marc Zyngier To: Jinjie Ruan Cc: , , , Thomas Gleixner , Mark Rutland , Will Deacon , "Rafael J. Wysocki" , Rob Herring , Saravana Kannan , Greg Kroah-Hartman , Sven Peter , Janne Grunau , Suzuki K Poulose , James Clark , Jonathan Cameron Subject: Re: [PATCH v3 13/26] genirq: Factor-in percpu irqaction creation In-Reply-To: <46d6bf56-3e7a-92d9-218f-4135d8850be9@huawei.com> References: <20250922082833.2038905-1-maz@kernel.org> <20250922082833.2038905-14-maz@kernel.org> <46d6bf56-3e7a-92d9-218f-4135d8850be9@huawei.com> 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/30.1 (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=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: ruanjinjie@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, tglx@linutronix.de, mark.rutland@arm.com, will@kernel.org, rafael@kernel.org, robh@kernel.org, saravanak@google.com, gregkh@linuxfoundation.org, sven@kernel.org, j@jannau.net, suzuki.poulose@arm.com, james.clark@linaro.org, jonathan.cameron@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 10 Oct 2025 04:59:59 +0100, Jinjie Ruan wrote: >=20 >=20 >=20 > On 2025/9/22 16:28, Marc Zyngier wrote: > > Move the code creating a per-cpu irqaction into its own helper, so that > > future changes to this code can be kept localised. > >=20 > > At the same time, fix the documentation which appears to say the wrong > > thing when it comes to interrupts being automatically enabled > > (percpu_devid interrupts never are). > >=20 > > Reviewed-by: Jonathan Cameron > > Signed-off-by: Marc Zyngier > > --- > > kernel/irq/manage.c | 40 ++++++++++++++++++++++++---------------- > > 1 file changed, 24 insertions(+), 16 deletions(-) > >=20 > > diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c > > index c94837382037e..d9ddc30678b5d 100644 > > --- a/kernel/irq/manage.c > > +++ b/kernel/irq/manage.c > > @@ -2442,6 +2442,24 @@ int setup_percpu_irq(unsigned int irq, struct ir= qaction *act) > > return retval; > > } > > =20 > > +static > > +struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsig= ned long flags, > > + const char *devname, void __percpu *dev_id) > > +{ > > + struct irqaction *action; > > + > > + action =3D kzalloc(sizeof(struct irqaction), GFP_KERNEL); > > + if (!action) > > + return NULL; > > + > > + action->handler =3D handler; > > + action->flags =3D flags | IRQF_PERCPU | IRQF_NO_SUSPEND; > > + action->name =3D devname; > > + action->percpu_dev_id =3D dev_id; > > + > > + return action; > > +} >=20 > This helper could be more universal by consider by distinguishing dev_id > and percpu_dev_id=EF=BC=8C so we can use it in request_nmi() and > request_threaded_irq() . This would mean either adding extra parameters to this function (ugly) or having type confusion by dropping the __percpu attribute (nasty). I'd rather you add a separate helper that deals with non-percpu interrupts, and not mess with something that is definitely meant for percpu interrupts. Thanks, M. --=20 Without deviation from the norm, progress is not possible.