Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irqdomain: Add parent field to struct irqchip_fwid

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 <lpieralisi@kernel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Acked-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260115-gicv5-host-acpi-v3-1-c13a9a150388@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Lorenzo Pieralisi and committed by
Rafael J. Wysocki
0323897a 8d9ad85d

+39 -5
+26 -4
include/linux/irqdomain.h
··· 257 257 258 258 #ifdef CONFIG_IRQ_DOMAIN 259 259 struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id, 260 - const char *name, phys_addr_t *pa); 260 + const char *name, phys_addr_t *pa, 261 + struct fwnode_handle *parent); 261 262 262 263 enum { 263 264 IRQCHIP_FWNODE_REAL, ··· 268 267 269 268 static inline struct fwnode_handle *irq_domain_alloc_named_fwnode(const char *name) 270 269 { 271 - return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED, 0, name, NULL); 270 + return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED, 0, name, NULL, NULL); 271 + } 272 + 273 + static inline 274 + struct fwnode_handle *irq_domain_alloc_named_parented_fwnode(const char *name, 275 + struct fwnode_handle *parent) 276 + { 277 + return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED, 0, name, NULL, parent); 272 278 } 273 279 274 280 static inline struct fwnode_handle *irq_domain_alloc_named_id_fwnode(const char *name, int id) 275 281 { 276 282 return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED_ID, id, name, 277 - NULL); 283 + NULL, NULL); 284 + } 285 + 286 + static inline 287 + struct fwnode_handle *irq_domain_alloc_named_id_parented_fwnode(const char *name, int id, 288 + struct fwnode_handle *parent) 289 + { 290 + return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_NAMED_ID, id, name, 291 + NULL, parent); 278 292 } 279 293 280 294 static inline struct fwnode_handle *irq_domain_alloc_fwnode(phys_addr_t *pa) 281 295 { 282 - return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, pa); 296 + return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, pa, NULL); 297 + } 298 + 299 + static inline struct fwnode_handle *irq_domain_alloc_parented_fwnode(phys_addr_t *pa, 300 + struct fwnode_handle *parent) 301 + { 302 + return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, pa, parent); 283 303 } 284 304 285 305 void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
+13 -1
kernel/irq/irqdomain.c
··· 33 33 34 34 struct irqchip_fwid { 35 35 struct fwnode_handle fwnode; 36 + struct fwnode_handle *parent; 36 37 unsigned int type; 37 38 char *name; 38 39 phys_addr_t *pa; ··· 54 53 return fwid->name; 55 54 } 56 55 56 + static struct fwnode_handle *irqchip_fwnode_get_parent(const struct fwnode_handle *fwnode) 57 + { 58 + struct irqchip_fwid *fwid = container_of(fwnode, struct irqchip_fwid, fwnode); 59 + 60 + return fwid->parent; 61 + } 62 + 57 63 const struct fwnode_operations irqchip_fwnode_ops = { 58 64 .get_name = irqchip_fwnode_get_name, 65 + .get_parent = irqchip_fwnode_get_parent, 59 66 }; 60 67 EXPORT_SYMBOL_GPL(irqchip_fwnode_ops); 61 68 ··· 74 65 * @id: Optional user provided id if name != NULL 75 66 * @name: Optional user provided domain name 76 67 * @pa: Optional user-provided physical address 68 + * @parent: Optional parent fwnode_handle 77 69 * 78 70 * Allocate a struct irqchip_fwid, and return a pointer to the embedded 79 71 * fwnode_handle (or NULL on failure). ··· 86 76 */ 87 77 struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id, 88 78 const char *name, 89 - phys_addr_t *pa) 79 + phys_addr_t *pa, 80 + struct fwnode_handle *parent) 90 81 { 91 82 struct irqchip_fwid *fwid; 92 83 char *n; ··· 115 104 fwid->type = type; 116 105 fwid->name = n; 117 106 fwid->pa = pa; 107 + fwid->parent = parent; 118 108 fwnode_init(&fwid->fwnode, &irqchip_fwnode_ops); 119 109 return &fwid->fwnode; 120 110 }