From nobody Sun Feb 8 16:49:42 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3589281532; Thu, 18 Dec 2025 10:15:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766052919; cv=none; b=rqxz/8XgkbJod338Kx3wajcN1eAzn4BhTkrnXnmIC53L9AocA/Gm1hoaMpNy1Uw5zMdKTBPE3lG3SDwiu+OgxTDYCEZB1DuHd8qrSWi8r1CvfHHMcO1um8UgqB3HX7S7H0ib6/umcOqg29j1zXkv7dtu0D4aJfjA4cInDY6yYK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766052919; c=relaxed/simple; bh=GJVTj8/Q1eWiuVLph/OBwj1vemW+Wer8nWvMvF151hI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Zsu6liE6d0nYMkxwvl4LEqQcHbGqIDVcGAwkFxHxhef+dm2QV+0TjGHfttPOFe9ehP84fNlcGl6LbMxZCQDgoHkQ2pIb5k1sXE0wYOwT0+03RMyxvpqUY+KTKz2zMmHtUtwL7suLgCrugl6mC1AkWSpN2v46TK9w9+lk7rJ69dE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ly05k+hP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ly05k+hP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4A90C19421; Thu, 18 Dec 2025 10:15:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766052919; bh=GJVTj8/Q1eWiuVLph/OBwj1vemW+Wer8nWvMvF151hI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Ly05k+hPNV70P3Z2zM20gHk5ANgv7lmpSZwDa/uy8qefGciy0CREV8pAC4QASs6sv mpWpXbGIv1cHs9Rsw09ZBNTI3Y7BfNsNLO8ghah62A/8VGPZ+YroTK8D/whGjabOBF 1jz0A2ZRc41mUwI6186K0vbtUEw/p/QA48gqMvLuyun3gokYNoxanjcbFnx4de+iFa oDVLJzfW1c5OJuY5JoxrE+3UUPCDO/lG5Z1IH25tR5SJrAD+Rw7AVCZstWpFf4QgkU VRZrjl0vwySDfJX5JtCz1X3b3htUHbuF/pw0OAG1ZTWrZTxx/vGT/6u2R2tZhsDzMC Fq8zXP+rjLESA== From: Lorenzo Pieralisi Date: Thu, 18 Dec 2025 11:14:29 +0100 Subject: [PATCH v2 3/7] irqdomain: Add parent field to struct irqchip_fwid Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251218-gicv5-host-acpi-v2-3-eec76cd1d40b@kernel.org> References: <20251218-gicv5-host-acpi-v2-0-eec76cd1d40b@kernel.org> In-Reply-To: <20251218-gicv5-host-acpi-v2-0-eec76cd1d40b@kernel.org> To: "Rafael J. Wysocki" , Len Brown , Robert Moore , Thomas Gleixner , Hanjun Guo , Sudeep Holla , Marc Zyngier , Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Lorenzo Pieralisi X-Mailer: b4 0.14.3 The GICv5 driver IRQ domain hierarchy requires adding a parent field to struct irqchip_fwid so that core code can reference a fwnode_handle parent for a given fwnode. Add a parent field to struct irqchip_fwid and update the related kernel API functions to initialize and handle it. Signed-off-by: Lorenzo Pieralisi Cc: Thomas Gleixner Cc: Marc Zyngier --- include/linux/irqdomain.h | 30 ++++++++++++++++++++++++++---- kernel/irq/irqdomain.c | 14 +++++++++++++- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 62f81bbeb490..b9df84b447a1 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -257,7 +257,8 @@ static inline void irq_domain_set_pm_device(struct irq_= domain *d, struct device =20 #ifdef CONFIG_IRQ_DOMAIN struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id, - const char *name, phys_addr_t *pa); + const char *name, phys_addr_t *pa, + struct fwnode_handle *parent); =20 enum { IRQCHIP_FWNODE_REAL, @@ -267,18 +268,39 @@ enum { =20 static inline struct fwnode_handle *irq_domain_alloc_named_fwnode(const ch= ar *name) { - return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED, 0, name, NULL); + return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED, 0, name, NULL, NUL= L); +} + +static inline +struct fwnode_handle *irq_domain_alloc_named_fwnode_parent(const char *nam= e, + struct fwnode_handle *parent) +{ + return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED, 0, name, NULL, par= ent); } =20 static inline struct fwnode_handle *irq_domain_alloc_named_id_fwnode(const= char *name, int id) { return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED_ID, id, name, - NULL); + NULL, NULL); +} + +static inline +struct fwnode_handle *irq_domain_alloc_named_id_fwnode_parent(const char *= name, int id, + struct fwnode_handle *parent) +{ + return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED_ID, id, name, + NULL, parent); } =20 static inline struct fwnode_handle *irq_domain_alloc_fwnode(phys_addr_t *p= a) { - return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, pa); + return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, pa, NULL); +} + +static inline struct fwnode_handle *irq_domain_alloc_fwnode_parent(phys_ad= dr_t *pa, + struct fwnode_handle *parent) +{ + return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, pa, parent= ); } =20 void irq_domain_free_fwnode(struct fwnode_handle *fwnode); diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 2652c4cfd877..baf77cd167c4 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -33,6 +33,7 @@ static void irq_domain_free_one_irq(struct irq_domain *do= main, unsigned int virq =20 struct irqchip_fwid { struct fwnode_handle fwnode; + struct fwnode_handle *parent; unsigned int type; char *name; phys_addr_t *pa; @@ -53,8 +54,16 @@ static const char *irqchip_fwnode_get_name(const struct = fwnode_handle *fwnode) return fwid->name; } =20 +static struct fwnode_handle *irqchip_fwnode_get_parent(const struct fwnode= _handle *fwnode) +{ + struct irqchip_fwid *fwid =3D container_of(fwnode, struct irqchip_fwid, f= wnode); + + return fwid->parent; +} + const struct fwnode_operations irqchip_fwnode_ops =3D { .get_name =3D irqchip_fwnode_get_name, + .get_parent =3D irqchip_fwnode_get_parent, }; EXPORT_SYMBOL_GPL(irqchip_fwnode_ops); =20 @@ -65,6 +74,7 @@ EXPORT_SYMBOL_GPL(irqchip_fwnode_ops); * @id: Optional user provided id if name !=3D NULL * @name: Optional user provided domain name * @pa: Optional user-provided physical address + * @parent: Optional parent fwnode_handle * * Allocate a struct irqchip_fwid, and return a pointer to the embedded * fwnode_handle (or NULL on failure). @@ -76,7 +86,8 @@ EXPORT_SYMBOL_GPL(irqchip_fwnode_ops); */ struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id, const char *name, - phys_addr_t *pa) + phys_addr_t *pa, + struct fwnode_handle *parent) { struct irqchip_fwid *fwid; char *n; @@ -104,6 +115,7 @@ struct fwnode_handle *__irq_domain_alloc_fwnode(unsigne= d int type, int id, fwid->type =3D type; fwid->name =3D n; fwid->pa =3D pa; + fwid->parent =3D parent; fwnode_init(&fwid->fwnode, &irqchip_fwnode_ops); return &fwid->fwnode; } --=20 2.50.1