From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753303AbdHOTCI (ORCPT ); Tue, 15 Aug 2017 15:02:08 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56164 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751576AbdHOTCG (ORCPT ); Tue, 15 Aug 2017 15:02:06 -0400 From: Marc Zyngier To: David Daney Cc: David Daney , Linus Walleij , Alexandre Courbot , Mark Rutland , Thomas Gleixner , , Subject: Re: [PATCH v7 3/5] irqdomain: Add irq_domain_{push,pop}_irq() functions. In-Reply-To: <84b23b62-0813-34eb-5afc-da21597d218f@caviumnetworks.com> (David Daney's message of "Tue, 15 Aug 2017 11:00:19 -0700") Organization: ARM Ltd References: <1502319099-2782-1-git-send-email-david.daney@cavium.com> <1502319099-2782-4-git-send-email-david.daney@cavium.com> <84b23b62-0813-34eb-5afc-da21597d218f@caviumnetworks.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Date: Tue, 15 Aug 2017 20:02:02 +0100 Message-ID: <861socy7rp.fsf@arm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 15 2017 at 11:00:19 am BST, David Daney 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.