Re: [PATCH 2/2] regmap: Allow setting IRQ domain name suffix

Matti Vaittinen
2024-07-08T12:40:30Z

On 7/7/24 21:13, Thomas Gleixner wrote:
> On Mon, Jul 01 2024 at 13:59, Matti Vaittinen wrote:
>> +static int regmap_irq_create_domain(struct fwnode_handle *fwnode, int irq_base,
>> + const struct regmap_irq_chip *chip,
>> + struct regmap_irq_chip_data *d)
>> +{
>> + struct irq_domain_info info = {
>> + .fwnode = fwnode,
>> + .size = irq_base + chip->num_irqs,
>> + .hwirq_max = irq_base + chip->num_irqs,
>
> This is not correct. irq_base is the linux interrupt number base. The
> first_hwirq argument of irq_domain_create_legacy() is 0.

I tried to pick the logic from the implementation of the
irq_domain_create_legacy() - but I must've missed something. I will
re-check this.

>
>> + .ops = &regmap_domain_ops,
>> + .host_data = d,
>> + .name_suffix = chip->domain_suffix,
>> + };
>> +
>> + d->domain = irq_domain_instantiate(&info);
>> + if (IS_ERR(d->domain)) {
>> + dev_err(d->map->dev, "Failed to create IRQ domain\n");
>> + return PTR_ERR(d->domain);
>> + }
>> +
>> + if (irq_base)
>> + irq_domain_associate_many(d->domain, irq_base, 0, chip->num_irqs);
>
> I wonder whether this can be handled at the core. Let me stare at it.

Thanks Thomas! I'll wait for your ideas before re-spinning this series :)

Yours,
-- Matti

--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~