From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753687AbdHOSA2 (ORCPT ); Tue, 15 Aug 2017 14:00:28 -0400 Received: from mail-sn1nam01on0047.outbound.protection.outlook.com ([104.47.32.47]:32864 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751427AbdHOSAZ (ORCPT ); Tue, 15 Aug 2017 14:00:25 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@cavium.com; Subject: Re: [PATCH v7 3/5] irqdomain: Add irq_domain_{push,pop}_irq() functions. To: Marc Zyngier , David Daney , Linus Walleij , Alexandre Courbot , Mark Rutland , Thomas Gleixner , linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org References: <1502319099-2782-1-git-send-email-david.daney@cavium.com> <1502319099-2782-4-git-send-email-david.daney@cavium.com> From: David Daney Message-ID: <84b23b62-0813-34eb-5afc-da21597d218f@caviumnetworks.com> Date: Tue, 15 Aug 2017 11:00:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: SN1PR0701CA0071.namprd07.prod.outlook.com (10.163.126.39) To DM5PR07MB3497.namprd07.prod.outlook.com (10.164.153.28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 362546a2-6451-437e-b590-08d4e4078062 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR07MB3497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kdjVz/kvQ81TWpanEYICmtkYBPRXtZXB0/CywpGDJRGKdh3aqE4E36kDrZJKttLtOrQXsmC+SEaVXjUC3Y1XhyhJ2PQsRHHOtoEkl7L8ns6YBo3KKcYXYvbqVAKkbmg/XiN1gk0p1MgrfLalj3+P1Ip4LNTzwjXN0Lb2/mNsOsnCDgbK0MlTJt7Ia4yl60341nY+wmNBYj6ICn5K2VtEeMg5ZKcJfRr+jf3fYh0VJs7M1lWOOxk/TxpX/7K2SUMEdQE7D4ZSAGnTUrkTB8Tl1SbG4f1ngHMglu/jfC+1kuSJ987sNHlmH8VESGYmKY52WHXbqPbVpnCR6EShDTs0h8ra4PxYiEsaPDkCkrNLSLrpxjFAJS0Cxj7yvbRrLIfolNYdhnpKEY/RSyye+aX6MNcgk2e1F2f1g4B3VD7KKk6mwBRNz1QMiTn0xXr2Z01QPxEyhZlwjgaiHvXrZcaXtIFtPBDe9JxpLr1dzV2a3ZJmqtwpNtkFyA=;4:+F3mI8hY67CTcoyGRJejAoz8hXNgrOnF6Mpun6LQaLuMSrqk6i+9xH+icz3m06JQsClyo8POfuZGEfztqqJ2qqpBDoutSWBTv4BtMsCttUAP0viC3rJWhz+SqHhD1Shlg0mTNdDcApZfj0kSrJtuigR3CL/YAFT3VRMGJVxirchRPoDKTsDlBoBATeVA2+c+s+gugo5J0mepUaEaVb+C1FhtPfrXZBSqIkKEBc7FcG1JxA+XQ3uRhjJRX+jHfnD76hPgxhUGlAaTRS46Bgw27zLm7IH8sBsW1K2xZqeV9pE= X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(10201501046)(3002001)(6041248)(20161123558100)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR07MB3497;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR07MB3497; X-Forefront-PRVS: 04004D94E2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(199003)(377454003)(189002)(24454002)(7736002)(42882006)(305945005)(31686004)(72206003)(68736007)(23676002)(8676002)(50466002)(6666003)(65806001)(4326008)(65956001)(6486002)(66066001)(81156014)(81166006)(31696002)(2906002)(97736004)(229853002)(53416004)(2950100002)(6506006)(4001350100001)(53546010)(42186005)(189998001)(5660300001)(105586002)(47776003)(54356999)(50986999)(6116002)(3846002)(76176999)(230700001)(65826007)(101416001)(7350300001)(33646002)(25786009)(106356001)(36756003)(6246003)(478600001)(53936002)(69596002)(64126003)(83506001)(6512007)(142933001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR07MB3497;H:ddl.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjA3TUIzNDk3OzIzOlk2SzZSVVh6N3hOY2NjVnlscUhybldjWEhi?= =?utf-8?B?UzVKZXpOT2UrTExYTjFRRVUraXJvMzZRcWx2R0tUdm9ZTVRrc091MWpWV0Js?= =?utf-8?B?VzFHUHc1aGkxNGpiUlFuTWhaUUVjaFNrMEludGpBRVY0NW0vN08zaDVwTTRY?= =?utf-8?B?cUZObFY3VlJXVERvb3kvbzljenRzQzNJWW82N0RXOHJrRjlwMFJiMnYyRkx2?= =?utf-8?B?a0xWZ1pBNnhHSWVMZldVNFlQOUtQcGZrdWUvRTl1VjFoSzFINUk5cGk5UXhZ?= =?utf-8?B?SVlVK3hhUXVseGVNYlkzTU02d3BxdzlweTFXcnZGemZ1MlAvUmo4cml6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6goMbPoexO3QdkuRHJwYKCpD2lFGP/L3FVo2u39sjcjc4F+Hm4mAEXTgovtLHNUP7HuMYXfZk+gPGzWO+/UVvTkKY89b5KqB6VEJMqrG9ngaeOfnBaTwyzQkOa6BGgB+aA==;5:IMQljKVXGlY0TMLHOCBzXticXbAeCofLFJONJFsg/JUhpeO9EHByJI8Ib7+nmfjmxrsu5Yr2TZeGAoksSAAcTzmnnAAZAyr/26VP3gSUdjkJnG93SiHXS80nkJRNGuVUP+Ywvz9T61aosDpNwnCfHw==;24:GYh2wUv8Z/4dPZXTbcmHFDS2O9XTqvExlQnsKBt9yauSUObmdKio07599XLgfD3bX6mqKrAccPeVwqvSHt1eC6SIXd/+z25xeGVl6iuA4TM=;7:PEYjpPAPJ/IdkK5KPcKlrKGoDe9CVo6WdH1z5/tVn68PXdDFlSx/GYR241cMPutk07XcKXiud5pvsYHzNDjsNkiqNsOx2wxzttRUIBmI+h1MzYPDalTAcrlTRQgCXQh3LqXstzBitcGecN8LpzR4EJWevKQzUe9qgNkJ3lt3fDSWX1jGht6upxXybBeR2fbb6whMORlPlSVH2tFtbloWx96qNAJhTJa2OpRa4n3GG60= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2017 18:00:22.5721 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3497 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > >> + mutex_unlock(&revmap_trees_mutex); >> +} >> + >> +/** >> + * irq_domain_push_irq() - Push a domain in to the top of a hierarchy. >> + * @domain: Domain to push. >> + * @virq: Irq to push the domain in to. >> + * @arg: Passed to the irq_domain_ops alloc() function. >> + * >> + * For an already existing irqdomain hierarchy, as might be obtained >> + * via a call to pci_enable_msix(), add an additional domain to the >> + * head of the processing chain. Must be called before request_irq() >> + * has been called. >> + */ >> +int irq_domain_push_irq(struct irq_domain *domain, int virq, void *arg) >> +{ >> + struct irq_data *child_irq_data; >> + struct irq_data *root_irq_data = irq_get_irq_data(virq); >> + struct irq_desc *desc; >> + int rv = 0; >> + >> + /* >> + * Check that no action has been set, which indicates the virq >> + * is in a state where this function doesn't have to deal with >> + * races between interrupt handling and maintaining the >> + * hierarchy. This will catch gross misuse. Attempting to >> + * make the check race free would require holding locks across >> + * calls to struct irq_domain_ops->alloc(), which could lead >> + * to deadlock, so we just do a simple check before starting. >> + */ >> + desc = irq_to_desc(virq); >> + if (!desc) >> + return -EINVAL; >> + if (WARN_ON(desc->action)) >> + return -EBUSY; >> + >> + if (domain == NULL) >> + return -EINVAL; >> + >> + if (WARN_ON(!domain->ops->alloc)) >> + return -EINVAL; > > I'd rather you use irq_domain_is_hierarchy() instead. Same effect, but > less likely to break in the long run. Good idea, I will do it. > >> + >> + if (!root_irq_data) >> + return -EINVAL; >> + >> + child_irq_data = kzalloc_node(sizeof(*child_irq_data), GFP_KERNEL, >> + irq_data_get_node(root_irq_data)); >> + if (!child_irq_data) >> + return -ENOMEM; >> + >> + mutex_lock(&irq_domain_mutex); >> + >> + /* Copy the original irq_data. */ >> + *child_irq_data = *root_irq_data; >> + >> + irq_domain_fix_revmap(child_irq_data); > > What is the benefit of updating the revmap early? The idea was to have it be valid for the ops->alloc() call, but ... > We don't do that in > the pop case. Can't we do it in one go once the allocation has succeeded? ... the code in irqdomain.c that calls ops->alloc() doesn't have revmap established at the call site, so I agree that this can go after the allocation so we don't have to undo it on failure. > >> + >> + /* >> + * Overwrite the root_irq_data, which is embedded in struct >> + * irq_desc, with values for this domain. >> + */ >> + root_irq_data->parent_data = child_irq_data; >> + root_irq_data->domain = domain; >> + root_irq_data->mask = 0; >> + root_irq_data->hwirq = 0; >> + root_irq_data->chip = NULL; >> + root_irq_data->chip_data = NULL; >> + rv = domain->ops->alloc(domain, virq, 1, arg); > > That'd be irq_domain_alloc_irqs_hierarchy(). > Yes. > Overall, I'm a bit concerned that alloc() is allowed to be recursive > itself. Hopefully nobody will do that, but you never know. A possible > way of trapping this would be to only set parent_data *after* the > allocation has been done. I will try it. > > Another concern is that I never see domain->parent being checked. It > should match child_irq_data->domain, so that you can never push a domain > on an interrupt that is not part of the parent domain. I will add a check for this. > >> + if (rv) { >> + /* Restore the original irq_data. */ >> + *root_irq_data = *child_irq_data; >> + irq_domain_fix_revmap(root_irq_data); >> + goto error; >> + } >> + >> + if (root_irq_data->hwirq < domain->revmap_size) { >> + domain->linear_revmap[root_irq_data->hwirq] = virq; >> + } else { >> + mutex_lock(&revmap_trees_mutex); >> + radix_tree_insert(&domain->revmap_tree, >> + root_irq_data->hwirq, root_irq_data); >> + mutex_unlock(&revmap_trees_mutex); >> + } > > We already have this exact code twice (in irq_domain_insert_irq and > irq_domain_associate). How about making it a helper? OK. > >> +error: >> + mutex_unlock(&irq_domain_mutex); >> + >> + return rv; >> +} >> +EXPORT_SYMBOL_GPL(irq_domain_push_irq); >> + >> +/** >> + * irq_domain_pop_irq() - Remove a domain from the top of a hierarchy. >> + * @domain: Domain to remove. >> + * @virq: Irq to remove the domain from. >> + * >> + * Undo the effects of a call to irq_domain_push_irq(). Must be >> + * called either before request_irq() or after free_irq(). >> + */ >> +int irq_domain_pop_irq(struct irq_domain *domain, int virq) >> +{ >> + struct irq_data *root_irq_data = irq_get_irq_data(virq); >> + struct irq_data *child_irq_data; >> + struct irq_data *tmp_irq_data; >> + struct irq_desc *desc; >> + >> + /* >> + * Check that no action is set, which indicates the virq is in >> + * a state where this function doesn't have to deal with races >> + * between interrupt handling and maintaining the hierarchy. >> + * This will catch gross misuse. Attempting to make the check >> + * race free would require holding locks across calls to >> + * struct irq_domain_ops->free(), which could lead to >> + * deadlock, so we just do a simple check before starting. >> + */ >> + desc = irq_to_desc(virq); >> + if (!desc) >> + return -EINVAL; >> + if (WARN_ON(desc->action)) >> + return -EBUSY; >> + >> + if (domain == NULL) >> + return -EINVAL; >> + >> + if (!root_irq_data) >> + return -EINVAL; >> + >> + tmp_irq_data = irq_domain_get_irq_data(domain, virq); >> + >> + /* We can only "pop" if this domain is at the top of the list */ >> + if (WARN_ON(root_irq_data != tmp_irq_data)) >> + return -EINVAL; >> + >> + if (WARN_ON(root_irq_data->domain != domain)) >> + return -EINVAL; >> + >> + child_irq_data = root_irq_data->parent_data; >> + if (WARN_ON(!child_irq_data)) >> + return -EINVAL; >> + >> + mutex_lock(&irq_domain_mutex); >> + >> + root_irq_data->parent_data = NULL; >> + >> + if (root_irq_data->hwirq >= domain->revmap_size) { >> + mutex_lock(&revmap_trees_mutex); >> + radix_tree_delete(&domain->revmap_tree, root_irq_data->hwirq); >> + mutex_unlock(&revmap_trees_mutex);ops->alloc() >> + } > > What about clearing it from the revmap if it fits there? Also, this code > already exists in irq_domain_disassociate and irq_domain_remove_irq, and > making that a helper is overdue. I will investigate doing something like that. > >> + >> + if (domain->ops->free) >> + domain->ops->free(domain, virq, 1); > > Use irq_domain_free_irqs_hierarchy(), making it conditional in that helper. OK > >> + >> + /* Restore the original irq_data. */ >> + *root_irq_data = *child_irq_data; >> + >> + irq_domain_fix_revmap(root_irq_data); >> + >> + mutex_unlock(&irq_domain_mutex); >> + >> + kfree(child_irq_data); >> + >> + return 0; >> +} >> +EXPORT_SYMBOL_GPL(irq_domain_pop_irq); >> + >> /** >> * irq_domain_free_irqs - Free IRQ number and associated data structures >> * @virq: base IRQ number >> > > Thanks, > > M. >