Re: [PATCH v7 3/5] irqdomain: Add irq_domain_{push,pop}_irq() functions.
From: Marc Zyngier
Date: Tue Aug 15 2017 - 15:02:13 EST
On Tue, Aug 15 2017 at 11:00:19 am BST, David Daney <ddaney@xxxxxxxxxxxxxxxxxx> wrote:
> On 08/15/2017 06:50 AM, Marc Zyngier wrote:
>> Hi David,
>>
>> On 09/08/17 23:51, David Daney wrote:
> [...]
>>> diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
>>> index f1f2514..629f770 100644
>>> --- a/kernel/irq/irqdomain.c
>>> +++ b/kernel/irq/irqdomain.c
>>> @@ -1448,6 +1448,184 @@ int __irq_domain_alloc_irqs(struct
> irq_domain *domain, int irq_base,
>>> return ret;
>>> }
>>> +/* The irq_data was moved, fix the revmap to refer to the new
>>> location */
>>> +static void irq_domain_fix_revmap(struct irq_data *d)
>>> +{
>>> + void **slot;
>>> +
>>> + if (d->hwirq < d->domain->revmap_size)
>>> + return; /* Not using radix tree. */
>>> +
>>> + /* Fix up the revmap. */
>>> + mutex_lock(&revmap_trees_mutex);
>>> + slot = radix_tree_lookup_slot(&d->domain->revmap_tree, d->hwirq);
>>> + if (slot)
>>> + radix_tree_replace_slot(&d->domain->revmap_tree, slot, d);
>>
>> radix_tree_replace_slot already deals with non-existing entries, so the
>> initial radix_tree_lookup_slot call is superfluous.
>
> This comment I don't understand. To replace an element in the tree,
> you must know the slot. I see no alternative to calling
> radix_tree_lookup_slot(). If I am mistaken, it would be helpful to
> know in a little more detail how you think it should be done.
Nah, you're right. I'm just grossly mistaken. Ignore this.
Thanks,
M.
--
Jazz is not dead. It just smells funny.