Re: [PATCH] genirq/generic-chip: Set IRQ_DOMAIN_FLAG_DESTROY_GC in irq_domain_alloc_generic_chips()
From: Thomas Gleixner
Date: Fri Sep 04 2026 - 02:37:06 EST
On Fri, Sep 04 2026 at 00:37, Herve Codina wrote:
> On Wed, 2 Sep 2026 14:59:39 +0800
> Qingshuang Fu <fuqingshuang@xxxxxxxxxx> wrote:
>> diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
>> index 2c8bc6ce082e..13b634053a3e 100644
>> --- a/kernel/irq/generic-chip.c
>> +++ b/kernel/irq/generic-chip.c
>> @@ -308,6 +308,7 @@ int irq_domain_alloc_generic_chips(struct irq_domain *d,
>> dgc->gc_flags = info->gc_flags;
>> dgc->exit = info->exit;
>> d->gc = dgc;
>> + d->flags |= IRQ_DOMAIN_FLAG_DESTROY_GC;
>>
>> /* Calc pointer to the first generic chip */
>> tmp += dgc_sz;
> The flag has been intended to be use with irq_domain_instantiate() which can call
> irq_domain_alloc_generic_chips() internally. Callers of irq_domain_instantiate()
> call only irq_remove_domain().
>
> Indeed calling only irq_domain_instantiate() and calling both
> irq_domain_remove_generic_chips() followed by irq_remove_domain() is, in that case,
> not consistent too.
>
> IHMO, if the flag IRQ_DOMAIN_FLAG_DESTROY_GC need to be automatically set
> somewhere, it could be in irq_domain_instantiate().
Yes, in the 'if (info->dgc_info)' branch.