From: Ian Campbell Subject: Re: [PATCH v5 2/6] xen/arm: IRQ: Store IRQ type in arch_irq_desc Date: Thu, 8 May 2014 11:03:22 +0100 Message-ID: <1399543402.9513.28.camel@kazak.uk.xensource.com> References: <1399045930-17364-1-git-send-email-julien.grall@linaro.org> <1399045930-17364-3-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WiLAn-0004xL-6A for xen-devel@lists.xenproject.org; Thu, 08 May 2014 10:03:29 +0000 In-Reply-To: <1399045930-17364-3-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2014-05-02 at 16:52 +0100, Julien Grall wrote: > For now, ARM uses different IRQ functions to setup an interrupt handler. This > is a bit annoying for common driver because we have to add idefery when > an IRQ is setup (see ns16550_init_postirq for an example). > > To avoid to completely fork the IRQ management code, we can introduce a field > to store the IRQ type (e.g level/edge ...). > > This patch also adds platform_get_irq which will retrieve the IRQ from the > device tree and setup correctly the IRQ type. > > In order to use this solution, we have to move init_IRQ earlier for the boot > CPU. It's fine because the code only depends on percpu. > > Signed-off-by: Julien Grall Looks good. But based on the comments raised previously I am wondering if static int ppi_types[NR_PPIS] which is set on configuration of such an interrupt and propagated to the cpu local copy when a CPU comes up? Apart from avoiding the slightly odd per_cpu(0) (even if hidden behind a macro) it also means that there is less need to be concerned about which processor ends up initialising an interrupt, which would simplify some stuff around irq_set_type and platform_get_irq (essentially you could then sanity check the change against ppi_types and then propagate to all online cpus without further checks). Thoughts?