From: Julien Grall Subject: [PATCH v5 p1 02/14] xen/dts: Allow only IRQ translation that are mapped to main GIC Date: Wed, 1 Apr 2015 17:21:35 +0100 Message-ID: <1427905307-23749-3-git-send-email-julien.grall@citrix.com> References: <1427905307-23749-1-git-send-email-julien.grall@citrix.com> 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 1YdLao-0007Pq-CU for xen-devel@lists.xenproject.org; Wed, 01 Apr 2015 16:34:14 +0000 In-Reply-To: <1427905307-23749-1-git-send-email-julien.grall@citrix.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: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org From: Julien Grall Xen is only able to handle one GIC controller. Some platforms may contain other interrupt controllers. Make sure to only translate IRQ mapped into the GIC handled by Xen. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini Acked-by: Ian Campbell --- Changes in v4: - Add Ian's and Stefano's ack Changes in v3: - Patch was previously sent a separate series [1] - Rework the comment in dt_irq_translate. Changelog based on the separate series: Changes in v3: - Add an ASSERT to check that dt_interrupt_controller is not NULL. Changes in v2: - Fix compilation... [1] https://patches.linaro.org/33312/ --- xen/common/device_tree.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index d1c716f..26fa298 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -1058,8 +1058,14 @@ int dt_irq_translate(const struct dt_raw_irq *raw, struct dt_irq *out_irq) { ASSERT(dt_irq_xlate != NULL); + ASSERT(dt_interrupt_controller != NULL); - /* TODO: Retrieve the right irq_xlate. This is only work for the gic */ + /* + * TODO: Retrieve the right irq_xlate. This is only works for the primary + * interrupt controller. + */ + if ( raw->controller != dt_interrupt_controller ) + return -EINVAL; return dt_irq_xlate(raw->specifier, raw->size, &out_irq->irq, &out_irq->type); -- 2.1.4