From: Ian Campbell Subject: Re: [PATCH v2 01/16] xen/arm: timer: replace timer_dt_irq by timer_get_irq Date: Mon, 7 Apr 2014 14:10:27 +0100 Message-ID: <1396876227.22845.79.camel@kazak.uk.xensource.com> References: <1396557727-19102-1-git-send-email-julien.grall@linaro.org> <1396557727-19102-2-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WX9Jo-0001qW-4x for xen-devel@lists.xenproject.org; Mon, 07 Apr 2014 13:10:32 +0000 In-Reply-To: <1396557727-19102-2-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 Thu, 2014-04-03 at 21:41 +0100, Julien Grall wrote: > The function is nearly only used to retrieve the IRQ number. > > There is one place where the IRQ type is used (in domain_build.c) but > as the timer IRQ is virtualised for guest we might not have the same property > (e.g active-low level sensitive interrupt). Is this statement impacted at all by Stefano switching things to use the LR.HW bit? > > Replace timer_dt_irq by timer_get_irq which will return the IRQ number. > > Signed-off-by: Julien Grall > @@ -647,17 +647,20 @@ static int make_timer_node(const struct domain *d, void *fdt, > if ( res ) > return res; > > - irq = timer_dt_irq(TIMER_PHYS_SECURE_PPI); > - DPRINT(" Secure interrupt %u\n", irq->irq); > - set_interrupt_ppi(intrs[0], irq->irq, 0xf, irq->type); > + /* The timer IRQ is emulated by Xen. It always exposes an active-low > + * level-sensitive interrupt */ > > - irq = timer_dt_irq(TIMER_PHYS_NONSECURE_PPI); > - DPRINT(" Non secure interrupt %u\n", irq->irq); > - set_interrupt_ppi(intrs[1], irq->irq, 0xf, irq->type); > + irq = timer_get_irq(TIMER_PHYS_SECURE_PPI); > + DPRINT(" Secure interrupt %u\n", irq); > + set_interrupt_ppi(intrs[0], irq, 0xf, DT_IRQ_TYPE_LEVEL_LOW); > > - irq = timer_dt_irq(TIMER_VIRT_PPI); > - DPRINT(" Virt interrupt %u\n", irq->irq); > - set_interrupt_ppi(intrs[2], irq->irq, 0xf, irq->type); > + irq = timer_get_irq(TIMER_PHYS_NONSECURE_PPI); > + DPRINT(" Non secure interrupt %u\n", irq); > + set_interrupt_ppi(intrs[1], irq, 0xf, DT_IRQ_TYPE_LEVEL_LOW); > + > + irq = timer_get_irq(TIMER_VIRT_PPI); > + DPRINT(" Virt interrupt %u\n", irq); > + set_interrupt_ppi(intrs[2], irq, 0xf, DT_IRQ_TYPE_LEVEL_LOW); > > res = fdt_property_interrupts(fdt, intrs, 3); > if ( res )