From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v6 1/6] xen/arm: IRQ: Store IRQ type in arch_irq_desc Date: Fri, 16 May 2014 11:43:46 +0100 Message-ID: <5375EBE2.9080903@linaro.org> References: <1399917438-21475-1-git-send-email-julien.grall@linaro.org> <1399917438-21475-2-git-send-email-julien.grall@linaro.org> <1400168737.19926.37.camel@kazak.uk.xensource.com> <5374F368.8040008@linaro.org> <1400235388.8259.17.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WlFcE-00071t-Tw for xen-devel@lists.xenproject.org; Fri, 16 May 2014 10:43:51 +0000 Received: by mail-ee0-f45.google.com with SMTP id d49so1414240eek.4 for ; Fri, 16 May 2014 03:43:49 -0700 (PDT) In-Reply-To: <1400235388.8259.17.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On 05/16/2014 11:16 AM, Ian Campbell wrote: > On Thu, 2014-05-15 at 18:03 +0100, Julien Grall wrote: >> On 05/15/2014 04:45 PM, Ian Campbell wrote: >>>> +int irq_set_type(unsigned int spi, unsigned int type) >>>> +{ >>>> + unsigned long flags; >>>> + struct irq_desc *desc = irq_to_desc(spi); >>>> + int ret = -EBUSY; >>>> + >>>> + /* This function should not be used for other than SPIs */ >>> >>> Perhaps name the function irq_set_spi_type or something then? >>> >>>> + for_each_cpu( cpu, &cpu_online_map ) >>>> + { >>>> + desc = &per_cpu(local_irq_desc, cpu)[irq]; >>>> + spin_lock_irqsave(&desc->lock, flags); >>>> + desc->arch.type = type; >>> >>> Don't you need to write ICFGR on each CPU? >> >> This function will bail out if local_irqs_type[irq] == DT_IRQ_TYPE_INVALID. > > Did you mean != ? Yes. We only want to configure IRQs that as not been configured. Regards, -- Julien Grall