From patchwork Wed Apr 1 16:21:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 46641 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6BF2B216D1 for ; Wed, 1 Apr 2015 16:36:05 +0000 (UTC) Received: by lbfb1 with SMTP id b1sf11759011lbf.2 for ; Wed, 01 Apr 2015 09:36:04 -0700 (PDT) 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:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=pQ4odk3c9pY1vrHivnMD69pZbP8vLL0CK9F47rg+6M4=; b=VlpBPYtEHDOpmDFfcLfAzGbu68mNaNMn98gWU+jvWdZNglEX42q2Cgh3pvtpvAT/OB iBEDAEMdklJ3d5OQc0QNce3tlQ+5t7fODDwZrv/1upHVhLNDPljxy3NOardRbqJFoc4F O5atW+C7/HiAjjy91RcPpJDewbAkFtcbnmHdi6hZe/SNRnZN6/5HQy+Cd2tckBe76W49 aik5nHoYQhtffHkXapABpGmCpQB4QndVxrqy9zln0NrCeRsHj+mqPTHhQeP01grRsqOS 1BQu8nHsRNC8hNqZ13sS+YS+wGpfUZK/5R7kJQ8YTcHLYHgqqd3c3F/X4KX+9Bm2UdoR 1qAQ== X-Gm-Message-State: ALoCoQlVxbh+UGhR0QwITXysSOyznVZONaQJmMslashM1GAUkd8ttAL/atnttu3TeAt0jb7UeOkX X-Received: by 10.112.166.164 with SMTP id zh4mr7079719lbb.20.1427906164232; Wed, 01 Apr 2015 09:36:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.6 with SMTP id i6ls101466lam.10.gmail; Wed, 01 Apr 2015 09:36:04 -0700 (PDT) X-Received: by 10.112.12.68 with SMTP id w4mr2078317lbb.87.1427906164121; Wed, 01 Apr 2015 09:36:04 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id jv1si2039472lbc.13.2015.04.01.09.36.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 09:36:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lajy8 with SMTP id y8so40928435laj.0 for ; Wed, 01 Apr 2015 09:36:04 -0700 (PDT) X-Received: by 10.112.162.232 with SMTP id yd8mr9920380lbb.41.1427906163974; Wed, 01 Apr 2015 09:36:03 -0700 (PDT) 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.57.201 with SMTP id k9csp777710lbq; Wed, 1 Apr 2015 09:36:03 -0700 (PDT) X-Received: by 10.140.81.20 with SMTP id e20mr21769091qgd.41.1427906162651; Wed, 01 Apr 2015 09:36:02 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id 73si2344321qhv.48.2015.04.01.09.35.59 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Apr 2015 09:36:02 -0700 (PDT) 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 1YdLaq-0007RX-Db; Wed, 01 Apr 2015 16:34:16 +0000 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 Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id FF/90-14319-50E1C155; Wed, 01 Apr 2015 16:34:13 +0000 X-Env-Sender: julien.grall@citrix.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1427906051!15002728!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 6.13.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 32684 invoked from network); 1 Apr 2015 16:34:13 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 1 Apr 2015 16:34:13 -0000 X-IronPort-AV: E=Sophos;i="5.11,504,1422921600"; d="scan'208";a="248610238" From: Julien Grall To: Date: Wed, 1 Apr 2015 17:21:35 +0100 Message-ID: <1427905307-23749-3-git-send-email-julien.grall@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1427905307-23749-1-git-send-email-julien.grall@citrix.com> References: <1427905307-23749-1-git-send-email-julien.grall@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v5 p1 02/14] 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: , 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: patch@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.49 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: 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);