From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964771AbbJMOix (ORCPT ); Tue, 13 Oct 2015 10:38:53 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:4180 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752699AbbJMOiw (ORCPT ); Tue, 13 Oct 2015 10:38:52 -0400 Subject: Re: [RFC v2 PATCH 07/14] irq: add a new generic IPI reservation code to irq core To: Thomas Gleixner References: <1444731382-19313-1-git-send-email-qais.yousef@imgtec.com> <1444731382-19313-8-git-send-email-qais.yousef@imgtec.com> CC: , , , , , From: Qais Yousef Message-ID: <561D1779.7060307@imgtec.com> Date: Tue, 13 Oct 2015 15:38:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.154.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/13/2015 02:37 PM, Thomas Gleixner wrote: > On Tue, 13 Oct 2015, Qais Yousef wrote: > >> + if (domain == NULL) >> + domain = irq_default_domain; /* need a separate ipi_default_domain? */ > No tail comments please. > > We should neither use irq_default_domain nor have an > ipi_default_domain. OK though I understood that you were OK with using the irq_default_domain. This means that arch code must parse the DT for an IPI domain. I think I've seen arch code using the root FDT to search for a specific node. I'll try to do something similar to search for an IPI domain. >> + >> + virq = irq_domain_alloc_descs(-1, nr_irqs, 0, NUMA_NO_NODE); >> + if (virq <= 0) { >> + pr_warn("Can't reserve IPI, failed to alloc descs\n"); >> + return 0; >> + } >> + >> + /* we are reusing hierarchy alloc function, should we create another one? */ >> + virq = __irq_domain_alloc_irqs(domain, virq, nr_irqs, NUMA_NO_NODE, >> + (void *) dest, true); >> + if (virq <= 0) { >> + pr_warn("Can't reserve IPI, failed to alloc irqs\n"); >> + goto free_descs; >> + } >> + >> + data = irq_get_irq_data(virq); >> + bitmap_copy(data->ipi_mask.cpumask, dest->cpumask, dest->nbits); >> + data->ipi_mask.nbits = dest->nbits; > This does only initialize the first virq data. What about the others? Right I missed that. I'll fix it. > >> + return virq; >> + >> +free_descs: >> + irq_free_descs(virq, nr_irqs); >> + return 0; >> +} >> + >> +/** >> + * irq_destroy_ipi() - unreserve an IPI that was previously allocated >> + * @irq: linux irq number to be destroyed >> + * >> + * Return an IPI allocated with irq_reserve_ipi() to the system. > That wants to explain that it actually destroys a number of virqs not > just the primary one. > > OK I'll expand on that. Thanks, Qais