From patchwork Thu Feb 12 06:34:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 44589 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A60E72151D for ; Thu, 12 Feb 2015 06:36:53 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id w7sf5131566lbi.0 for ; Wed, 11 Feb 2015 22:36:52 -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=X4iPI2q0bKq3jjARNE9N3g4w1IOCwb05pO8ri7zNhwo=; b=VvsKt/OGHoiYE73z6jZL/mgPkhauuHu6JFQro5ErGFa4ZgBWsd5RoG+WoRJTqf2jOI PpgoJd2sFQzpNGHRYkv6LzyUWO1X8dZqFvRrDwVjIZvVQuq+o7YmT8ql8P3r9/Okw+NY zffzmlrtXV8x6+YRbWMwAB5214sqr8QkRvjZTGn0Wz8Sn6LdkLvnyv6Eji1JezQJRqWT lAmzXfoSSxPflk0JRNRvNgaX+D6kzCgTCyVl+wgfGovW4Kg/oKlvMn7B+SDUPcSHjCMz c8nTOqFHk8yctDoLQajSR5LI2mVv3PLKNPR6gX4oSSreFMaT1KOyeAEy7haCZBPXlv6c yJ1w== X-Gm-Message-State: ALoCoQlKs2SMUQiCtxeWSidYZfIeMr31Aql0we0O+96ITPJluKOnhznXM6aw+Bd5Pv1KKDyVT07A X-Received: by 10.112.161.201 with SMTP id xu9mr291072lbb.11.1423723012556; Wed, 11 Feb 2015 22:36:52 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.229 with SMTP id d5ls142721lab.75.gmail; Wed, 11 Feb 2015 22:36:52 -0800 (PST) X-Received: by 10.112.135.196 with SMTP id pu4mr1799489lbb.41.1423723012411; Wed, 11 Feb 2015 22:36:52 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id r3si2295474lbo.9.2015.02.11.22.36.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 22:36:52 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labhz20 with SMTP id hz20so8006373lab.0 for ; Wed, 11 Feb 2015 22:36:52 -0800 (PST) X-Received: by 10.152.116.18 with SMTP id js18mr1073607lab.106.1423723012004; Wed, 11 Feb 2015 22:36:52 -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.35.133 with SMTP id h5csp254664lbj; Wed, 11 Feb 2015 22:36:51 -0800 (PST) X-Received: by 10.140.38.114 with SMTP id s105mr6487339qgs.106.1423723010798; Wed, 11 Feb 2015 22:36:50 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id 45si3959465qgf.98.2015.02.11.22.36.50 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 11 Feb 2015 22:36:50 -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 1YLnMg-0001Md-7H; Thu, 12 Feb 2015 06:35:06 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YLnMf-0001MS-8t for xen-devel@lists.xenproject.org; Thu, 12 Feb 2015 06:35:05 +0000 Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id FA/45-02754-8994CD45; Thu, 12 Feb 2015 06:35:04 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-9.tower-21.messagelabs.com!1423722902!13381118!1 X-Originating-IP: [209.85.192.177] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17369 invoked from network); 12 Feb 2015 06:35:03 -0000 Received: from mail-pd0-f177.google.com (HELO mail-pd0-f177.google.com) (209.85.192.177) by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 12 Feb 2015 06:35:03 -0000 Received: by pdjy10 with SMTP id y10so9798482pdj.13 for ; Wed, 11 Feb 2015 22:35:02 -0800 (PST) X-Received: by 10.68.68.165 with SMTP id x5mr3934420pbt.23.1423722902287; Wed, 11 Feb 2015 22:35:02 -0800 (PST) Received: from localhost.localdomain.localdomain ([210.177.145.249]) by mx.google.com with ESMTPSA id dx6sm2696149pab.14.2015.02.11.22.35.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 22:35:01 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org, linux-arm-kernel@lists.infradead.org Date: Thu, 12 Feb 2015 06:34:57 +0000 Message-Id: <1423722898-16110-2-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1423722898-16110-1-git-send-email-julien.grall@linaro.org> References: <1423722898-16110-1-git-send-email-julien.grall@linaro.org> Cc: ard.biesheuvel@linaro.org, ian.campbell@citrix.com, Julien Grall , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH 1/2] arm/xen: Correctly check if the event channel interrupt is present 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.50 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: The function irq_of_parse_and_map returns 0 when the IRQ is not found. Furthermore xen_events_irq is only read when the CPU is bring up, so it's not necessary to use the attribute __read_mostly. Lastly, move the check before notifying the user that we are running on Xen. Signed-off-by: Julien Grall --- arch/arm/xen/enlighten.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 263a204..90101c8 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -51,7 +51,7 @@ EXPORT_SYMBOL_GPL(xen_have_vector_callback); int xen_platform_pci_unplug = XEN_UNPLUG_ALL; EXPORT_SYMBOL_GPL(xen_platform_pci_unplug); -static __read_mostly int xen_events_irq = -1; +static unsigned int xen_events_irq; /* map fgmfn of domid to lpfn in the current domain */ static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn, @@ -251,12 +251,14 @@ static int __init xen_guest_init(void) return 0; grant_frames = res.start; xen_events_irq = irq_of_parse_and_map(node, 0); + if (!xen_events_irq) { + pr_debug("Xen event channel interrupt not found\n"); + return -ENODEV; + } + pr_info("Xen %s support found, events_irq=%d gnttab_frame=%pa\n", version, xen_events_irq, &grant_frames); - if (xen_events_irq < 0) - return -ENODEV; - xen_domain_type = XEN_HVM_DOMAIN; xen_setup_features();