Re: [PATCH v3 3/3] genirq: Use the maple tree for IRQ descriptors management

From: Shanker Donthineni
Date: Wed May 10 2023 - 13:16:05 EST


Hi Thomas,

On 5/10/23 10:19, Shanker Donthineni wrote:

Apologies for my lack of familiarity with the maple tree data structure and
not testing all functions. I received advice from the review comments below
regarding the iterator. I am looking for your guidance to address the issue
with the iterator if not possible can we increase NR_IRQS for ARM64 arch.


https://lore.kernel.org/linux-arm-kernel/875ydej9ur.ffs@tglx/

static unsigned int irq_find_next_irq(unsigned int offset)
{
        MA_STATE(mas, &sparse_irqs, offset, nr_irqs);
        struct irq_desc *desc = mas_next(&mas, nr_irqs);

        return desc ? irq_desc_get_irq(desc) : nr_irqs;
}

The problem has been resolved, and I have confirmed the functionality of
CPU hot-unplug on ARM64 systems. I have posted v4 to fix the issue.

https://lore.kernel.org/lkml/20230510170033.3303076-4-sdonthineni@xxxxxxxxxx/T/#mfa8e2a5490f275cfecb2e93473c24f35db7adcaf

I have made the change of replacing mt_next() with mt_find() in irq_find_next_irq() function.
static unsigned int irq_find_next_irq(unsigned int offset)
{
unsigned long index = offset;
struct irq_desc *desc = mt_find(&sparse_irqs, &index, nr_irqs);

return desc ? irq_desc_get_irq(desc) : nr_irqs;
}

-Shanker