From patchwork Tue Jan 13 14:25:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 43011 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7CED220DE8 for ; Tue, 13 Jan 2015 14:28:35 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf1876114lab.1 for ; Tue, 13 Jan 2015 06:28:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=iqUB89ynt9BXi7Kv2qyMBX7B4FK+VOt7rpAWrIED+2A=; b=Lpl8g1fc62CMCIqtjSH+bYaCDib+/88dwHM2u97PoXVVwdY1lcfZGgIV9cZicOOpNh aSy5thoHNVqrZs10pR/Fe5qcGxoLJdbENs1FYxVPf7R+NDoeTj6csyjK4rOTbgiSyq6g aExrv5LDfUlT8LJRg08IzuLzfqfaZ5tgDV6LNS4OkfinAbseuM3KCZth/lyRwA3nY6vL u0Zd7n1ZQFWjXWBHshTFQJPZRlgdRo49Ehrs1ecEIzl7nPAJk16SrZ7OAqAQuoCL7DSx Ux0/YQ3Q2zmckg5yiApdXgkolSLpQv/is8zpALZ6VHaS04CQ/MT9+LWVYAs4nvvCd2kQ yRyg== X-Gm-Message-State: ALoCoQnWkhC1Z3/KykzoDQVLRQqpv/17eIOCtiWIhx3qFh0+4u44HWsH2BDrSO1m3tHUZt8cmFWc X-Received: by 10.152.2.40 with SMTP id 8mr326587lar.7.1421159314359; Tue, 13 Jan 2015 06:28:34 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.235 with SMTP id jf11ls796043lac.74.gmail; Tue, 13 Jan 2015 06:28:34 -0800 (PST) X-Received: by 10.152.30.6 with SMTP id o6mr43002981lah.64.1421159314156; Tue, 13 Jan 2015 06:28:34 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id pw5si24373221lbb.93.2015.01.13.06.28.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 06:28:34 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ms9so2868679lab.10 for ; Tue, 13 Jan 2015 06:28:34 -0800 (PST) X-Received: by 10.112.98.99 with SMTP id eh3mr42078926lbb.32.1421159313936; Tue, 13 Jan 2015 06:28:33 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1398931lbb; Tue, 13 Jan 2015 06:28:33 -0800 (PST) X-Received: by 10.52.92.79 with SMTP id ck15mr17946600vdb.63.1421159291780; Tue, 13 Jan 2015 06:28:11 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id dy7si1133154vdc.25.2015.01.13.06.28.11 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 13 Jan 2015 06:28:11 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YB2QQ-00014f-Ax; Tue, 13 Jan 2015 14:26:30 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YB2QO-00013q-TJ for xen-devel@lists.xenproject.org; Tue, 13 Jan 2015 14:26:29 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id 6E/93-27584-41B25B45; Tue, 13 Jan 2015 14:26:28 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-6.tower-206.messagelabs.com!1421159187!17782206!1 X-Originating-IP: [74.125.82.46] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6117 invoked from network); 13 Jan 2015 14:26:27 -0000 Received: from mail-wg0-f46.google.com (HELO mail-wg0-f46.google.com) (74.125.82.46) by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 13 Jan 2015 14:26:27 -0000 Received: by mail-wg0-f46.google.com with SMTP id x13so3247387wgg.5 for ; Tue, 13 Jan 2015 06:26:27 -0800 (PST) X-Received: by 10.194.142.234 with SMTP id rz10mr2089858wjb.118.1421159187155; Tue, 13 Jan 2015 06:26:27 -0800 (PST) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id ni15sm14513482wic.18.2015.01.13.06.26.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 06:26:26 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 13 Jan 2015 14:25:12 +0000 Message-Id: <1421159133-31526-4-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v3 03/24] xen/dts: Allow only IRQ translation that are mapped to main GIC X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Xen is only able to handle one GIC controller. Some platform may contain other interrupt controller. Make sure to only translate IRQ mapped into the GIC handled by Xen. Signed-off-by: Julien Grall --- 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 f471008..bb9d7ce 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);