[PATCH v2 4/8] irqchip: armada-370-xp: implement MSI support
Thomas Petazzoni
thomas.petazzoni at free-electrons.com
Tue Jun 18 06:36:43 EDT 2013
Dear Grant Likely,
On Tue, 18 Jun 2013 11:15:38 +0100, Grant Likely wrote:
> > + if (domain == NULL)
> > + domain = irq_default_domain;
>
> Drop the above 2 lines. You absolutely must know what irq_domain you
> want to operate on when calling this function. There is no situation
> where the default domain is what should be used.
Sure, makes sense.
> > +
> > + for (hwirq = 0; hwirq < domain->hwirq_max; hwirq++)
> > + if (!irq_find_mapping(domain, hwirq))
> > + break;
>
> Ugh. This will be slow on domains with a high hwirq_max and low
> revmap_size since all the lookups will go out to the radix tree. Blech.
> Not much to do about it though at this point without implementing some
> kind of fast lookup path. To do it right would require iterating over
> the radix tree looking for a hole.
So to conclude you would leave it as I proposed for now?
An option is to make irq_alloc_mapping() work only on linear domains,
where hwirq_max == revmap_size, and return an error otherwise.
> Once a free hwirq has been found, it would be better to call
> irq_create_mapping() directly rather than open coding it.
Thanks, will do.
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
More information about the linux-arm-kernel
mailing list